summaryrefslogtreecommitdiff
path: root/fs/bcachefs/reflink.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-10-09 16:44:36 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:29 +0300
commitdaf3fe502a4c20be99579097cc351e91d27fc789 (patch)
treee96a6c0e8d925fd7aab4d225791400e6c39f93f3 /fs/bcachefs/reflink.c
parent14989d547ee308033e080792239e640e076a4460 (diff)
downloadlinux-daf3fe502a4c20be99579097cc351e91d27fc789.tar.xz
bcachefs: Check if extending inode differently
In bch2_extent_update(), we have to update the inode if i_size is changing (the file is being extend) or if i_sectors is changing, but we want to avoid touching the inode if it's not necessary. Change sum_sector_overwrites() to also check if there's already data above where we're writing to - this means we're definitely not extending the file. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/reflink.c')
-rw-r--r--fs/bcachefs/reflink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/reflink.c b/fs/bcachefs/reflink.c
index f1b0e7fc8487..de4c8b075a65 100644
--- a/fs/bcachefs/reflink.c
+++ b/fs/bcachefs/reflink.c
@@ -213,7 +213,7 @@ s64 bch2_remap_range(struct bch_fs *c,
if (bkey_cmp(dst_iter->pos, dst_want) < 0) {
ret = bch2_fpunch_at(&trans, dst_iter, dst_want,
- dst_inode, new_i_size);
+ dst_inode);
if (ret)
goto btree_err;
continue;