summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-03-29 14:34:10 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2019-03-29 14:35:08 -0400
commit4158220b72e334b63381aa039e3b1f98e9932b63 (patch)
tree4724eb3f75b97c309401bdf6e9be86b4a802fbc1
parentac74f3a8bedab704aee10008c4e969e55c622176 (diff)
bcachefs: make sure to use BTREE_INSERT_LAZY_RW in fsck
-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 5c2329d91bcc..bc501d40dfed 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -90,7 +90,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);
@@ -100,7 +102,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);
@@ -482,7 +485,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);
@@ -750,7 +754,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: */
@@ -794,7 +800,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;
@@ -808,7 +816,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;