diff options
| author | Jan Kara <jack@suse.cz> | 2005-01-03 04:12:36 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-03 04:12:36 -0800 |
| commit | 84f308c2eb1d08e80c8b896037e0c4dde3ced11f (patch) | |
| tree | abb86afc16c5549cc6c7b691db3a4ca79f24528e /include/linux | |
| parent | cf684334cbbc8406337727d3f4be722b4fb49c4b (diff) | |
[PATCH] quota umount race fix
Fix possible races between umount and quota on/off.
Finally I decided to take a reference to vfsmount during vfs_quota_on() and
to drop it after the final cleanup in the vfs_quota_off(). This way we
should be all the time guarded against umount. This way was protected also
the old code which used filp_open() for opening quota files. I was also
thinking about other ways of protection but there would be always a window
(provided I don't want to play much with namespace locks) where
vfs_quota_on() could be called while umount() is in progress resulting in
the "Busy inodes after unmount" messages...
Get a reference to vfsmount during quotaon() so that we are guarded against
umount (as was the old code using filp_open()).
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/quota.h | 1 | ||||
| -rw-r--r-- | include/linux/quotaops.h | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/quota.h b/include/linux/quota.h index a279602bbb94..ac5b90f4f256 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -286,6 +286,7 @@ struct quota_info { struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */ struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ + struct vfsmount *mnt[MAXQUOTAS]; /* mountpoint entries of filesystems with quota files */ struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ }; diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index acc926c64e78..e57baa85e744 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -177,7 +177,7 @@ static __inline__ int DQUOT_OFF(struct super_block *sb) { int ret = -ENOSYS; - if (sb->s_qcop && sb->s_qcop->quota_off) + if (sb_any_quota_enabled(sb) && sb->s_qcop && sb->s_qcop->quota_off) ret = sb->s_qcop->quota_off(sb, -1); return ret; } |
