Skip to content
Snippets Groups Projects
Commit 00684e93 authored by Baokun Li's avatar Baokun Li Committed by Sasha Levin
Browse files

quota: simplify drop_dquot_ref()


[ Upstream commit 7bce48f0 ]

As Honza said, remove_inode_dquot_ref() currently does not release the
last dquot reference but instead adds the dquot to tofree_head list. This
is because dqput() can sleep while dropping of the last dquot reference
(writing back the dquot and calling ->release_dquot()) and that must not
happen under dq_list_lock. Now that dqput() queues the final dquot cleanup
into a workqueue, remove_inode_dquot_ref() can call dqput() unconditionally
and we can significantly simplify it.

Here we open code the simplified code of remove_inode_dquot_ref() into
remove_dquot_ref() and remove the function put_dquot_list() which is no
longer used.

Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Message-Id: <20230630110822.3881712-6-libaokun1@huawei.com>
Stable-dep-of: 179b8c97 ("quota: Fix rcu annotations of inode dquot pointers")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2e005642
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment