]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
quota: Hold s_umount in exclusive mode when enabling / disabling quotas
authorJan Kara <jack@suse.cz>
Wed, 23 Nov 2016 12:16:10 +0000 (13:16 +0100)
committerJan Kara <jack@suse.cz>
Thu, 24 Nov 2016 14:26:53 +0000 (15:26 +0100)
commit7d6cd73d33b62021111a469b6a454ec357be295f
tree7feaea7fdb5d8d49c07a0836fd6f9dcc54290e69
parentba6379f7e6c7e51b3c0e92672bc61bb6961c2b5e
quota: Hold s_umount in exclusive mode when enabling / disabling quotas

Currently we hold s_umount semaphore only in shared mode when enabling
or disabling quotas and use dqonoff_mutex for serializing quota state
changes on a filesystem and also quota state changes with other places
depending on current quota state. Using dedicated mutex for this causes
possible deadlocks during filesystem freezing (see following commit for
details) so we transition to using s_umount semaphore for the necessary
synchronization whose lock ordering is properly handled by the
filesystem freezing code. As a start grab s_umount in exclusive mode
when enabling / disabling quotas.

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