diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-11-05 06:22:13 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:31 +0300 |
commit | 677fc0562a237f6cfc1551e37673707096905ca7 (patch) | |
tree | 092384642a5c7af378eb1ad62fcc8e9c5c5d7850 /fs/bcachefs/reflink.c | |
parent | 4a1d8d3efcdedd0911941f236b2e3a6347f518c3 (diff) | |
download | linux-677fc0562a237f6cfc1551e37673707096905ca7.tar.xz |
bcachefs: Some reflink fixes
len might fit into a loff_t when aligned_len does not - make sure we use
a u64 for aligned_len. Also, we weren't always extending the inode
correctly.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/reflink.c')
-rw-r--r-- | fs/bcachefs/reflink.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/reflink.c b/fs/bcachefs/reflink.c index 6d45ae24479d..6e71c5e8f9a2 100644 --- a/fs/bcachefs/reflink.c +++ b/fs/bcachefs/reflink.c @@ -290,10 +290,12 @@ err: ret2 = PTR_ERR_OR_ZERO(inode_iter); if (!ret2 && - 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) ?: bch2_trans_commit(&trans, NULL, journal_seq, BTREE_INSERT_ATOMIC); + } } while (ret2 == -EINTR); ret = bch2_trans_exit(&trans) ?: ret; |