Peter Teoh
2008-Mar-14 21:55 UTC
[Btrfs-devel] Transaction counter comes before BUG_ON() check?
kmem_cache_alloc() can return NULL value. Shouldn't the transaction count comes after BUG_ON check for NULL ptr returned by kmem_cache_alloc()? Thanks. -- Regards, Peter Teoh -------------- next part -------------- A non-text attachment was scrubbed... Name: total_transaction_count.patch Type: text/x-patch Size: 500 bytes Desc: not available Url : http://oss.oracle.com/pipermail/btrfs-devel/attachments/20080315/86573358/total_transaction_count.bin
Peter Teoh
2008-Mar-14 23:24 UTC
[Btrfs-devel] Re: Transaction counter comes before BUG_ON() check?
kmem_cache_alloc() can return NULL value. Shouldn't the transaction count comes after BUG_ON check for NULL ptr returned by kmem_cache_alloc()? Signed-off-by: Peter Teoh <htmldeveloper@gmail.com> --- transaction.c.orig 2008-03-15 12:46:32.000000000 +0800 +++ transaction.c 2008-03-15 12:47:46.000000000 +0800 @@ -53,8 +53,8 @@ static noinline int join_transaction(str if (!cur_trans) { cur_trans = kmem_cache_alloc(btrfs_transaction_cachep, GFP_NOFS); - total_trans++; BUG_ON(!cur_trans); + total_trans++; root->fs_info->generation++; root->fs_info->running_transaction = cur_trans; root->fs_info->last_alloc = 0;