summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fsck.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-11 06:51:16 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-01 19:47:41 +0300
commit002c76dcf6a49a82498e8cddcde75e0dd83f745a (patch)
treec08ae79e14a748667958c67a5136f5cd74f6b14f /fs/bcachefs/fsck.c
parent38ced43bb04ac59b1417f520f4d5a5c3bc3d1e57 (diff)
downloadlinux-002c76dcf6a49a82498e8cddcde75e0dd83f745a.tar.xz
bcachefs: check_root() can now be run online
check_root() is simple enough to run as one single transaction, so is trivial to run online. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fsck.c')
-rw-r--r--fs/bcachefs/fsck.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c
index 8b77098dde2d..d0cd6020bd9a 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -1950,14 +1950,10 @@ static int check_root_trans(struct btree_trans *trans)
root_subvol.v.flags = 0;
root_subvol.v.snapshot = cpu_to_le32(snapshot);
root_subvol.v.inode = cpu_to_le64(inum);
- ret = commit_do(trans, NULL, NULL,
- BCH_TRANS_COMMIT_no_enospc,
- bch2_btree_insert_trans(trans, BTREE_ID_subvolumes,
- &root_subvol.k_i, 0));
+ ret = bch2_btree_insert_trans(trans, BTREE_ID_subvolumes, &root_subvol.k_i, 0);
bch_err_msg(c, ret, "writing root subvol");
if (ret)
goto err;
-
}
ret = __lookup_inode(trans, BCACHEFS_ROOT_INO, &root_inode, &snapshot);
@@ -1984,9 +1980,7 @@ fsck_err:
/* Get root directory, create if it doesn't exist: */
int bch2_check_root(struct bch_fs *c)
{
- int ret;
-
- ret = bch2_trans_do(c, NULL, NULL, BCH_TRANS_COMMIT_no_enospc,
+ int ret = bch2_trans_do(c, NULL, NULL, BCH_TRANS_COMMIT_no_enospc,
check_root_trans(trans));
bch_err_fn(c, ret);
return ret;