mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 22:14:36 -04:00
bcachefs: make sure to use BTREE_INSERT_LAZY_RW in fsck
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
0bc166ff56
commit
9d455b24be
@@ -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 @@ static int check_root(struct bch_fs *c, struct bch_inode_unpacked *root_inode)
|
||||
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 @@ static int check_lostfound(struct bch_fs *c,
|
||||
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 @@ static int check_lostfound(struct bch_fs *c,
|
||||
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user