summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/fsck.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-03-29 14:34:10 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:19 -0400
commit9d455b24be5239df23757042703419de9351e461 (patch)
treef203112671d609bb0345d06860499bd597847879 /fs/bcachefs/fsck.c
parent0bc166ff564f9e2b0bfc7a0c1a92472a600f901d (diff)
downloadlinux-stable-9d455b24be5239df23757042703419de9351e461.tar.gz
linux-stable-9d455b24be5239df23757042703419de9351e461.tar.bz2
linux-stable-9d455b24be5239df23757042703419de9351e461.zip
bcachefs: make sure to use BTREE_INSERT_LAZY_RW in fsck
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fsck.c')
-rw-r--r--fs/bcachefs/fsck.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c
index c4d9d2761cdc..79e4b1b6a556 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -91,7 +91,9 @@ static int reattach_inode(struct bch_fs *c,
bch2_inode_pack(&packed, lostfound_inode);
ret = bch2_btree_insert(c, BTREE_ID_INODES, &packed.inode.k_i,
- NULL, NULL, BTREE_INSERT_NOFAIL);
+ NULL, NULL,
+ BTREE_INSERT_NOFAIL|
+ BTREE_INSERT_LAZY_RW);
if (ret) {
bch_err(c, "error %i reattaching inode %llu while updating lost+found",
ret, inum);
@@ -101,7 +103,8 @@ static int reattach_inode(struct bch_fs *c,
ret = bch2_dirent_create(c, lostfound_inode->bi_inum,
&lostfound_hash_info,
DT_DIR, &name, inum, NULL,
- BTREE_INSERT_NOFAIL);
+ BTREE_INSERT_NOFAIL|
+ BTREE_INSERT_LAZY_RW);
if (ret) {
bch_err(c, "error %i reattaching inode %llu while creating new dirent",
ret, inum);
@@ -483,7 +486,8 @@ static int check_extents(struct bch_fs *c)
ret = bch2_btree_insert(c, BTREE_ID_INODES,
&p.inode.k_i, NULL, NULL,
- BTREE_INSERT_NOFAIL);
+ BTREE_INSERT_NOFAIL|
+ BTREE_INSERT_LAZY_RW);
if (ret) {
bch_err(c, "error in fs gc: error %i "
"updating inode", ret);
@@ -751,7 +755,9 @@ create_root:
bch2_inode_pack(&packed, root_inode);
return bch2_btree_insert(c, BTREE_ID_INODES, &packed.inode.k_i,
- NULL, NULL, BTREE_INSERT_NOFAIL);
+ NULL, NULL,
+ BTREE_INSERT_NOFAIL|
+ BTREE_INSERT_LAZY_RW);
}
/* Get lost+found, create if it doesn't exist: */
@@ -795,7 +801,9 @@ create_lostfound:
bch2_inode_pack(&packed, root_inode);
ret = bch2_btree_insert(c, BTREE_ID_INODES, &packed.inode.k_i,
- NULL, NULL, BTREE_INSERT_NOFAIL);
+ NULL, NULL,
+ BTREE_INSERT_NOFAIL|
+ BTREE_INSERT_LAZY_RW);
if (ret)
return ret;
@@ -809,7 +817,8 @@ create_lostfound:
ret = bch2_dirent_create(c, BCACHEFS_ROOT_INO, &root_hash_info, DT_DIR,
&lostfound, lostfound_inode->bi_inum, NULL,
- BTREE_INSERT_NOFAIL);
+ BTREE_INSERT_NOFAIL|
+ BTREE_INSERT_LAZY_RW);
if (ret)
return ret;