Commit da187cac authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Kill missing inode warnings in bch2_quota_read()

bch2_quota_read(), when scanning for inodes, may attempt to look up
inodes that have been deleted in the main subvolume - this is not an
error.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent c7afec9b
......@@ -318,7 +318,7 @@ int bch2_inode_unpack(struct bkey_s_c k,
return bch2_inode_unpack_slowpath(k, unpacked);
}
int bch2_inode_peek(struct btree_trans *trans,
static int bch2_inode_peek_nowarn(struct btree_trans *trans,
struct btree_iter *iter,
struct bch_inode_unpacked *inode,
subvol_inum inum, unsigned flags)
......@@ -349,7 +349,17 @@ int bch2_inode_peek(struct btree_trans *trans,
return 0;
err:
bch2_trans_iter_exit(trans, iter);
if (!bch2_err_matches(ret, BCH_ERR_transaction_restart))
return ret;
}
int bch2_inode_peek(struct btree_trans *trans,
struct btree_iter *iter,
struct bch_inode_unpacked *inode,
subvol_inum inum, unsigned flags)
{
int ret = bch2_inode_peek_nowarn(trans, iter, inode, inum, flags);
if (ret && !bch2_err_matches(ret, BCH_ERR_transaction_restart))
bch_err_msg(trans->c, ret, "looking up inum %u:%llu:", inum.subvol, inum.inum);
return ret;
}
......@@ -880,6 +890,19 @@ int bch2_inode_rm(struct bch_fs *c, subvol_inum inum)
return ret;
}
int bch2_inode_find_by_inum_nowarn_trans(struct btree_trans *trans,
subvol_inum inum,
struct bch_inode_unpacked *inode)
{
struct btree_iter iter;
int ret;
ret = bch2_inode_peek_nowarn(trans, &iter, inode, inum, 0);
if (!ret)
bch2_trans_iter_exit(trans, &iter);
return ret;
}
int bch2_inode_find_by_inum_trans(struct btree_trans *trans,
subvol_inum inum,
struct bch_inode_unpacked *inode)
......
......@@ -118,6 +118,9 @@ int bch2_inode_create(struct btree_trans *, struct btree_iter *,
int bch2_inode_rm(struct bch_fs *, subvol_inum);
int bch2_inode_find_by_inum_nowarn_trans(struct btree_trans *,
subvol_inum,
struct bch_inode_unpacked *);
int bch2_inode_find_by_inum_trans(struct btree_trans *, subvol_inum,
struct bch_inode_unpacked *);
int bch2_inode_find_by_inum(struct bch_fs *, subvol_inum,
......
......@@ -572,7 +572,7 @@ static int bch2_fs_quota_read_inode(struct btree_trans *trans,
if (!s_t.master_subvol)
goto advance;
ret = bch2_inode_find_by_inum_trans(trans,
ret = bch2_inode_find_by_inum_nowarn_trans(trans,
(subvol_inum) {
le32_to_cpu(s_t.master_subvol),
k.k->p.offset,
......
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