summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/subvolume.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-09-30 06:00:33 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2024-10-05 02:25:32 +0200
commit72350ee0ea22c053f2683e50f1beba97df2ad053 (patch)
tree19e834f7638161214ab1baf522223f1421ec37bf /fs/bcachefs/subvolume.c
parentbcachefs: Check for unlinked, non-empty dirs in check_inode() (diff)
downloadlinux-72350ee0ea22c053f2683e50f1beba97df2ad053.tar.xz
linux-72350ee0ea22c053f2683e50f1beba97df2ad053.zip
bcachefs: Kill snapshot arg to fsck_write_inode()
It was initially believed that it would be better to be explicit about the snapshot we're updating when writing inodes in fsck; however, it turns out that passing around the snapshot separately is more error prone and we're usually updating the inode in the same snapshow we read it from. This is different from normal filesystem paths, where we do the update in the snapshot of the subvolume we're in. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to '')
-rw-r--r--fs/bcachefs/subvolume.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c
index 6845dde1b339..44210a86c367 100644
--- a/fs/bcachefs/subvolume.c
+++ b/fs/bcachefs/subvolume.c
@@ -102,7 +102,8 @@ static int check_subvol(struct btree_trans *trans,
inode.bi_inum, inode.bi_snapshot,
inode.bi_subvol, subvol.k->p.offset)) {
inode.bi_subvol = subvol.k->p.offset;
- ret = __bch2_fsck_write_inode(trans, &inode, le32_to_cpu(subvol.v->snapshot));
+ inode.bi_snapshot = le32_to_cpu(subvol.v->snapshot);
+ ret = __bch2_fsck_write_inode(trans, &inode);
if (ret)
goto err;
}