summaryrefslogtreecommitdiff
path: root/fs/bcachefs/quota.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-10-11 04:32:41 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:50 -0400
commitc72f687a1ff1801b404fab804fdddcaf034e6ef4 (patch)
tree53648acc4521cf44688250b6402edf871bec0781 /fs/bcachefs/quota.c
parent5b3008bc6182e56fdd5ba36fdf324430d0792e0c (diff)
downloadlwn-c72f687a1ff1801b404fab804fdddcaf034e6ef4.tar.gz
lwn-c72f687a1ff1801b404fab804fdddcaf034e6ef4.zip
bcachefs: Use for_each_btree_key_upto() more consistently
It's important that in BTREE_ITER_FILTER_SNAPSHOTS mode we always use peek_upto() and provide an end for the interval we're searching for - otherwise, when we hit the end of the inode the next inode be in a different subvolume and not have any keys in the current snapshot, and we'd iterate over arbitrarily many keys before returning one. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/quota.c')
-rw-r--r--fs/bcachefs/quota.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/quota.c b/fs/bcachefs/quota.c
index ededc826e9a0..4b663f320bfc 100644
--- a/fs/bcachefs/quota.c
+++ b/fs/bcachefs/quota.c
@@ -709,7 +709,7 @@ static int bch2_quota_remove(struct super_block *sb, unsigned uflags)
ret = bch2_btree_delete_range(c, BTREE_ID_quotas,
POS(QTYP_USR, 0),
- POS(QTYP_USR + 1, 0),
+ POS(QTYP_USR, U64_MAX),
0, NULL);
if (ret)
return ret;
@@ -721,7 +721,7 @@ static int bch2_quota_remove(struct super_block *sb, unsigned uflags)
ret = bch2_btree_delete_range(c, BTREE_ID_quotas,
POS(QTYP_GRP, 0),
- POS(QTYP_GRP + 1, 0),
+ POS(QTYP_GRP, U64_MAX),
0, NULL);
if (ret)
return ret;
@@ -733,7 +733,7 @@ static int bch2_quota_remove(struct super_block *sb, unsigned uflags)
ret = bch2_btree_delete_range(c, BTREE_ID_quotas,
POS(QTYP_PRJ, 0),
- POS(QTYP_PRJ + 1, 0),
+ POS(QTYP_PRJ, U64_MAX),
0, NULL);
if (ret)
return ret;