提交 264ca0f6 编写于 作者: Z Zhao Lei 提交者: Chris Mason

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: NZhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: NChris Mason <clm@fb.com>
上级 f2ab7618
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册