quota: Detect loops in quota tree
authorJan Kara <jack@suse.cz>
Wed, 7 Feb 2024 18:12:15 +0000 (19:12 +0100)
committerJan Kara <jack@suse.cz>
Mon, 12 Feb 2024 13:14:49 +0000 (14:14 +0100)
commita898cb621ac589b0b9e959309689a027e765aa12
treed455bf2010b6d807a79ad5e46e0b2df658daea1e
parentccb49011bb2ebfd66164dbf68c5bff48917bb5ef
quota: Detect loops in quota tree

Syzbot has found that when it creates corrupted quota files where the
quota tree contains a loop, we will deadlock when tryling to insert a
dquot. Add loop detection into functions traversing the quota tree.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/quota/quota_tree.c
fs/quota/quota_v2.c