Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-quota-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-quota-2.6: quota: Fix possible deadlock during parallel quotaon and quotaoff
This commit is contained in:
commit
728b690fd5
1 changed files with 2 additions and 2 deletions
|
@ -2042,8 +2042,8 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id,
|
||||||
* changes */
|
* changes */
|
||||||
invalidate_bdev(sb->s_bdev);
|
invalidate_bdev(sb->s_bdev);
|
||||||
}
|
}
|
||||||
mutex_lock(&inode->i_mutex);
|
|
||||||
mutex_lock(&dqopt->dqonoff_mutex);
|
mutex_lock(&dqopt->dqonoff_mutex);
|
||||||
|
mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
|
||||||
if (sb_has_quota_loaded(sb, type)) {
|
if (sb_has_quota_loaded(sb, type)) {
|
||||||
error = -EBUSY;
|
error = -EBUSY;
|
||||||
goto out_lock;
|
goto out_lock;
|
||||||
|
@ -2094,7 +2094,6 @@ out_file_init:
|
||||||
dqopt->files[type] = NULL;
|
dqopt->files[type] = NULL;
|
||||||
iput(inode);
|
iput(inode);
|
||||||
out_lock:
|
out_lock:
|
||||||
mutex_unlock(&dqopt->dqonoff_mutex);
|
|
||||||
if (oldflags != -1) {
|
if (oldflags != -1) {
|
||||||
down_write(&dqopt->dqptr_sem);
|
down_write(&dqopt->dqptr_sem);
|
||||||
/* Set the flags back (in the case of accidental quotaon()
|
/* Set the flags back (in the case of accidental quotaon()
|
||||||
|
@ -2104,6 +2103,7 @@ out_lock:
|
||||||
up_write(&dqopt->dqptr_sem);
|
up_write(&dqopt->dqptr_sem);
|
||||||
}
|
}
|
||||||
mutex_unlock(&inode->i_mutex);
|
mutex_unlock(&inode->i_mutex);
|
||||||
|
mutex_unlock(&dqopt->dqonoff_mutex);
|
||||||
out_fmt:
|
out_fmt:
|
||||||
put_quota_format(fmt);
|
put_quota_format(fmt);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue