Commit 9d455b24 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: make sure to use BTREE_INSERT_LAZY_RW in fsck

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 0bc166ff
...@@ -91,7 +91,9 @@ static int reattach_inode(struct bch_fs *c, ...@@ -91,7 +91,9 @@ static int reattach_inode(struct bch_fs *c,
bch2_inode_pack(&packed, lostfound_inode); bch2_inode_pack(&packed, lostfound_inode);
ret = bch2_btree_insert(c, BTREE_ID_INODES, &packed.inode.k_i, 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) { if (ret) {
bch_err(c, "error %i reattaching inode %llu while updating lost+found", bch_err(c, "error %i reattaching inode %llu while updating lost+found",
ret, inum); ret, inum);
...@@ -101,7 +103,8 @@ static int reattach_inode(struct bch_fs *c, ...@@ -101,7 +103,8 @@ static int reattach_inode(struct bch_fs *c,
ret = bch2_dirent_create(c, lostfound_inode->bi_inum, ret = bch2_dirent_create(c, lostfound_inode->bi_inum,
&lostfound_hash_info, &lostfound_hash_info,
DT_DIR, &name, inum, NULL, DT_DIR, &name, inum, NULL,
BTREE_INSERT_NOFAIL); BTREE_INSERT_NOFAIL|
BTREE_INSERT_LAZY_RW);
if (ret) { if (ret) {
bch_err(c, "error %i reattaching inode %llu while creating new dirent", bch_err(c, "error %i reattaching inode %llu while creating new dirent",
ret, inum); ret, inum);
...@@ -483,7 +486,8 @@ static int check_extents(struct bch_fs *c) ...@@ -483,7 +486,8 @@ static int check_extents(struct bch_fs *c)
ret = bch2_btree_insert(c, BTREE_ID_INODES, ret = bch2_btree_insert(c, BTREE_ID_INODES,
&p.inode.k_i, NULL, NULL, &p.inode.k_i, NULL, NULL,
BTREE_INSERT_NOFAIL); BTREE_INSERT_NOFAIL|
BTREE_INSERT_LAZY_RW);
if (ret) { if (ret) {
bch_err(c, "error in fs gc: error %i " bch_err(c, "error in fs gc: error %i "
"updating inode", ret); "updating inode", ret);
...@@ -751,7 +755,9 @@ static int check_root(struct bch_fs *c, struct bch_inode_unpacked *root_inode) ...@@ -751,7 +755,9 @@ static int check_root(struct bch_fs *c, struct bch_inode_unpacked *root_inode)
bch2_inode_pack(&packed, root_inode); bch2_inode_pack(&packed, root_inode);
return bch2_btree_insert(c, BTREE_ID_INODES, &packed.inode.k_i, 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: */ /* Get lost+found, create if it doesn't exist: */
...@@ -795,7 +801,9 @@ static int check_lostfound(struct bch_fs *c, ...@@ -795,7 +801,9 @@ static int check_lostfound(struct bch_fs *c,
bch2_inode_pack(&packed, root_inode); bch2_inode_pack(&packed, root_inode);
ret = bch2_btree_insert(c, BTREE_ID_INODES, &packed.inode.k_i, 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) if (ret)
return ret; return ret;
...@@ -809,7 +817,8 @@ static int check_lostfound(struct bch_fs *c, ...@@ -809,7 +817,8 @@ static int check_lostfound(struct bch_fs *c,
ret = bch2_dirent_create(c, BCACHEFS_ROOT_INO, &root_hash_info, DT_DIR, ret = bch2_dirent_create(c, BCACHEFS_ROOT_INO, &root_hash_info, DT_DIR,
&lostfound, lostfound_inode->bi_inum, NULL, &lostfound, lostfound_inode->bi_inum, NULL,
BTREE_INSERT_NOFAIL); BTREE_INSERT_NOFAIL|
BTREE_INSERT_LAZY_RW);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment