diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-11-10 01:20:06 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:16 +0300 |
commit | 770e821485e0021ea325f7aa2133fddb46ba0821 (patch) | |
tree | 54d6098f1de000c119d515e853947938e47c6d09 /fs/bcachefs/reflink.c | |
parent | 74163da7c81ac5bb4ecd625f9e41a241ec5d8758 (diff) | |
download | linux-770e821485e0021ea325f7aa2133fddb46ba0821.tar.xz |
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: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/reflink.c')
-rw-r--r-- | fs/bcachefs/reflink.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/reflink.c b/fs/bcachefs/reflink.c index d003f4088dfc..22230f82b8b9 100644 --- a/fs/bcachefs/reflink.c +++ b/fs/bcachefs/reflink.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; 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); |