diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-08 12:35:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-08 12:35:50 -0400 |
commit | 728b690fd5c185c639a5db0819bd6e0385b14188 (patch) | |
tree | ee5d5c9791a88bfe71bba747979d05af7bd28090 | |
parent | ed7ba2ef09254b2fd9698708b407f4652d26e36a (diff) | |
parent | d01730d74d2b0155da50d44555001706294014f7 (diff) |
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
-rw-r--r-- | fs/quota/dquot.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 607c579e5eca..70f36c043d62 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -2042,8 +2042,8 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id, | |||
2042 | * changes */ | 2042 | * changes */ |
2043 | invalidate_bdev(sb->s_bdev); | 2043 | invalidate_bdev(sb->s_bdev); |
2044 | } | 2044 | } |
2045 | mutex_lock(&inode->i_mutex); | ||
2046 | mutex_lock(&dqopt->dqonoff_mutex); | 2045 | mutex_lock(&dqopt->dqonoff_mutex); |
2046 | mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA); | ||
2047 | if (sb_has_quota_loaded(sb, type)) { | 2047 | if (sb_has_quota_loaded(sb, type)) { |
2048 | error = -EBUSY; | 2048 | error = -EBUSY; |
2049 | goto out_lock; | 2049 | goto out_lock; |
@@ -2094,7 +2094,6 @@ out_file_init: | |||
2094 | dqopt->files[type] = NULL; | 2094 | dqopt->files[type] = NULL; |
2095 | iput(inode); | 2095 | iput(inode); |
2096 | out_lock: | 2096 | out_lock: |
2097 | mutex_unlock(&dqopt->dqonoff_mutex); | ||
2098 | if (oldflags != -1) { | 2097 | if (oldflags != -1) { |
2099 | down_write(&dqopt->dqptr_sem); | 2098 | down_write(&dqopt->dqptr_sem); |
2100 | /* Set the flags back (in the case of accidental quotaon() | 2099 | /* Set the flags back (in the case of accidental quotaon() |
@@ -2104,6 +2103,7 @@ out_lock: | |||
2104 | up_write(&dqopt->dqptr_sem); | 2103 | up_write(&dqopt->dqptr_sem); |
2105 | } | 2104 | } |
2106 | mutex_unlock(&inode->i_mutex); | 2105 | mutex_unlock(&inode->i_mutex); |
2106 | mutex_unlock(&dqopt->dqonoff_mutex); | ||
2107 | out_fmt: | 2107 | out_fmt: |
2108 | put_quota_format(fmt); | 2108 | put_quota_format(fmt); |
2109 | 2109 | ||