aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2015-02-17 04:25:51 -0500
committerChris Mason <clm@fb.com>2015-04-13 10:27:24 -0400
commit264ca0f60becac34395f3b42171ad0cc2e53ea6e (patch)
treeffe0eb263005f0e749f6a08e5f44763528b15d4d /fs/btrfs/extent-tree.c
parentf2ab76188ec185dde84e7fe7c533ef2f5d668a32 (diff)
btrfs: Adjust commit-transaction condition to avoid NO_SPACE more
If we have any chance to make a successful write, we should not give up. This patch adjust commit-transaction condition from: pinned >= wanted to left + pinned >= wanted Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 7b227a65078c..01f4db6554a1 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3931,7 +3931,8 @@ alloc:
3931 * don't bother committing the transaction. 3931 * don't bother committing the transaction.
3932 */ 3932 */
3933 if (percpu_counter_compare(&data_sinfo->total_bytes_pinned, 3933 if (percpu_counter_compare(&data_sinfo->total_bytes_pinned,
3934 bytes) < 0) 3934 used + bytes -
3935 data_sinfo->total_bytes) < 0)
3935 have_pinned_space = 0; 3936 have_pinned_space = 0;
3936 spin_unlock(&data_sinfo->lock); 3937 spin_unlock(&data_sinfo->lock);
3937 3938