mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 23:20:32 -04:00
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: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user