summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/quota_global.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-11-23 13:35:14 +0100
committerJan Kara <jack@suse.cz>2016-11-24 15:27:16 +0100
commit9d1ccbe70e0b14545caad12dc73adb3605447df0 (patch)
tree9a8b6122cf02f099996bf5137bbec4d9e4e8799d /fs/ocfs2/quota_global.c
parentquota: Hold s_umount in exclusive mode when enabling / disabling quotas (diff)
downloadlinux-9d1ccbe70e0b14545caad12dc73adb3605447df0.tar.xz
linux-9d1ccbe70e0b14545caad12dc73adb3605447df0.zip
quota: Use s_umount protection for quota operations
Writeback quota is protected by s_umount semaphore held for reading because every writeback must be protected by that lock (grabbed either by the generic writeback code or by quotactl handler). Getting next available ID in quota file, querying quota state, setting quota information, getting quota format are all quotactl operations protected by s_umount semaphore held for reading grabbed in quotactl handler. This also fixes lockdep splat about possible deadlock during filesystem freezing where sync_filesystem() is called with page-faults already blocked but sync_filesystem() calls into dquot_writeback_dquots() which grabs dqonoff_mutex which ranks above i_mutex (vfs_load_quota_inode() grabs i_mutex under dqonoff_mutex) which clearly ranks below page fault freeze protection (e.g. via mmap_sem dependencies). The reported problem is not a real deadlock possibility since during quota on we check whether filesystem freezing is not in progress but still it is good to have this fixed. Reported-by: Ted Tso <tytso@mit.edu> Reported-by: Eric Whitney <enwlinux@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ocfs2/quota_global.c')
0 files changed, 0 insertions, 0 deletions