diff options
author | Jan Kara <jack@suse.cz> | 2009-11-12 15:42:08 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2009-12-10 15:02:51 +0100 |
commit | c56818d7dc976a7392be82e8e04fe26347d591f3 (patch) | |
tree | 28c40dcb53198dc6870bb75b0250458579ade727 /fs/quota | |
parent | 1472da5fdc65f0cd286c655758d629346001e126 (diff) | |
download | kernel_samsung_smdk4412-c56818d7dc976a7392be82e8e04fe26347d591f3.zip kernel_samsung_smdk4412-c56818d7dc976a7392be82e8e04fe26347d591f3.tar.gz kernel_samsung_smdk4412-c56818d7dc976a7392be82e8e04fe26347d591f3.tar.bz2 |
quota: Fix WARN_ON in lookup_one_len
We should hold i_mutex when looking up quota files for journaled quotas,
otherwise a WARN_ON in lookup_one_len triggers. The fact that we didn't
hold i_mutex previously probably could not lead to a real bug since the
filesystem is just being mounted / remounted read-write and thus the
root directory cannot change anyway but it's definitely cleaner with
i_mutex.
Reported-by: Bastien ROUCARIES <roucaries.bastien@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/quota')
-rw-r--r-- | fs/quota/dquot.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index eb5a755..cd6bb9a 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2164,7 +2164,9 @@ int vfs_quota_on_mount(struct super_block *sb, char *qf_name, struct dentry *dentry; int error; + mutex_lock(&sb->s_root->d_inode->i_mutex); dentry = lookup_one_len(qf_name, sb->s_root, strlen(qf_name)); + mutex_unlock(&sb->s_root->d_inode->i_mutex); if (IS_ERR(dentry)) return PTR_ERR(dentry); |