Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 264ca0f6 authored by Zhao Lei's avatar Zhao Lei Committed by Chris Mason
Browse files

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: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent f2ab7618
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3931,7 +3931,8 @@ int btrfs_check_data_free_space(struct inode *inode, u64 bytes)
		 * don't bother committing the transaction.
		 */
		if (percpu_counter_compare(&data_sinfo->total_bytes_pinned,
					   bytes) < 0)
					   used + bytes -
					   data_sinfo->total_bytes) < 0)
			have_pinned_space = 0;
		spin_unlock(&data_sinfo->lock);