From: Josef Bacik Date: Fri, 14 Oct 2011 17:37:45 +0000 (-0400) Subject: Btrfs: don't check bytes_pinned to determine if we should commit the transaction X-Git-Tag: firefly_0821_release~3680^2~3894^2~78^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bbb495c2ed9d34894cb3d6d366866fc92a2e1adc;p=firefly-linux-kernel-4.4.55.git Btrfs: don't check bytes_pinned to determine if we should commit the transaction Before the only reason to commit the transaction to recover space in reserve_metadata_bytes() was if there were enough pinned_bytes to satisfy our reservation. But now we have the delayed inode stuff which will hold it's reservations until we commit the transaction. So say we max out our reservation by creating a bunch of files but don't have any pinned bytes we will ENOSPC out early even though we could commit the transaction and get that space back. So now just unconditionally commit the transaction since currently there is no way to know how much metadata space is being reserved by delayed inode stuff. Thanks, Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index fc0de6880045..79365a40cb3a 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3568,17 +3568,6 @@ again: goto again; } - /* - * Not enough space to be reclaimed, don't bother committing the - * transaction. - */ - spin_lock(&space_info->lock); - if (space_info->bytes_pinned < orig_bytes) - ret = -ENOSPC; - spin_unlock(&space_info->lock); - if (ret) - goto out; - ret = -EAGAIN; if (trans) goto out;