Commit 770e8214 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Inode updates should generally be BTREE_INSERT_NOFAIL

This fixes a bug where i_size may become inconsistent between the VFS
cache and the btree, when the filesystem is nearly full.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 74163da7
...@@ -347,7 +347,8 @@ s64 bch2_remap_range(struct bch_fs *c, ...@@ -347,7 +347,8 @@ s64 bch2_remap_range(struct bch_fs *c,
inode_u.bi_size < new_i_size) { inode_u.bi_size < new_i_size) {
inode_u.bi_size = new_i_size; inode_u.bi_size = new_i_size;
ret2 = bch2_inode_write(&trans, &inode_iter, &inode_u) ?: ret2 = bch2_inode_write(&trans, &inode_iter, &inode_u) ?:
bch2_trans_commit(&trans, NULL, NULL, 0); bch2_trans_commit(&trans, NULL, NULL,
BTREE_INSERT_NOFAIL);
} }
bch2_trans_iter_exit(&trans, &inode_iter); bch2_trans_iter_exit(&trans, &inode_iter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment