aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dquot.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dquot.c')
-rw-r--r--fs/dquot.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/dquot.c b/fs/dquot.c
index 2a62b3dc20ec..cb6d5bfbdfd5 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -100,7 +100,7 @@
100 * operation is just reading pointers from inode (or not using them at all) the 100 * operation is just reading pointers from inode (or not using them at all) the
101 * read lock is enough. If pointers are altered function must hold write lock 101 * read lock is enough. If pointers are altered function must hold write lock
102 * (these locking rules also apply for S_NOQUOTA flag in the inode - note that 102 * (these locking rules also apply for S_NOQUOTA flag in the inode - note that
103 * for altering the flag i_sem is also needed). If operation is holding 103 * for altering the flag i_mutex is also needed). If operation is holding
104 * reference to dquot in other way (e.g. quotactl ops) it must be guarded by 104 * reference to dquot in other way (e.g. quotactl ops) it must be guarded by
105 * dqonoff_sem. 105 * dqonoff_sem.
106 * This locking assures that: 106 * This locking assures that:
@@ -117,9 +117,9 @@
117 * spinlock to internal buffers before writing. 117 * spinlock to internal buffers before writing.
118 * 118 *
119 * Lock ordering (including related VFS locks) is the following: 119 * Lock ordering (including related VFS locks) is the following:
120 * i_sem > dqonoff_sem > iprune_sem > journal_lock > dqptr_sem > 120 * i_mutex > dqonoff_sem > iprune_sem > journal_lock > dqptr_sem >
121 * > dquot->dq_lock > dqio_sem 121 * > dquot->dq_lock > dqio_sem
122 * i_sem on quota files is special (it's below dqio_sem) 122 * i_mutex on quota files is special (it's below dqio_sem)
123 */ 123 */
124 124
125static DEFINE_SPINLOCK(dq_list_lock); 125static DEFINE_SPINLOCK(dq_list_lock);
@@ -1369,11 +1369,11 @@ int vfs_quota_off(struct super_block *sb, int type)
1369 /* If quota was reenabled in the meantime, we have 1369 /* If quota was reenabled in the meantime, we have
1370 * nothing to do */ 1370 * nothing to do */
1371 if (!sb_has_quota_enabled(sb, cnt)) { 1371 if (!sb_has_quota_enabled(sb, cnt)) {
1372 down(&toputinode[cnt]->i_sem); 1372 mutex_lock(&toputinode[cnt]->i_mutex);
1373 toputinode[cnt]->i_flags &= ~(S_IMMUTABLE | 1373 toputinode[cnt]->i_flags &= ~(S_IMMUTABLE |
1374 S_NOATIME | S_NOQUOTA); 1374 S_NOATIME | S_NOQUOTA);
1375 truncate_inode_pages(&toputinode[cnt]->i_data, 0); 1375 truncate_inode_pages(&toputinode[cnt]->i_data, 0);
1376 up(&toputinode[cnt]->i_sem); 1376 mutex_unlock(&toputinode[cnt]->i_mutex);
1377 mark_inode_dirty(toputinode[cnt]); 1377 mark_inode_dirty(toputinode[cnt]);
1378 iput(toputinode[cnt]); 1378 iput(toputinode[cnt]);
1379 } 1379 }
@@ -1417,7 +1417,7 @@ static int vfs_quota_on_inode(struct inode *inode, int type, int format_id)
1417 write_inode_now(inode, 1); 1417 write_inode_now(inode, 1);
1418 /* And now flush the block cache so that kernel sees the changes */ 1418 /* And now flush the block cache so that kernel sees the changes */
1419 invalidate_bdev(sb->s_bdev, 0); 1419 invalidate_bdev(sb->s_bdev, 0);
1420 down(&inode->i_sem); 1420 mutex_lock(&inode->i_mutex);
1421 down(&dqopt->dqonoff_sem); 1421 down(&dqopt->dqonoff_sem);
1422 if (sb_has_quota_enabled(sb, type)) { 1422 if (sb_has_quota_enabled(sb, type)) {
1423 error = -EBUSY; 1423 error = -EBUSY;
@@ -1449,7 +1449,7 @@ static int vfs_quota_on_inode(struct inode *inode, int type, int format_id)
1449 goto out_file_init; 1449 goto out_file_init;
1450 } 1450 }
1451 up(&dqopt->dqio_sem); 1451 up(&dqopt->dqio_sem);
1452 up(&inode->i_sem); 1452 mutex_unlock(&inode->i_mutex);
1453 set_enable_flags(dqopt, type); 1453 set_enable_flags(dqopt, type);
1454 1454
1455 add_dquot_ref(sb, type); 1455 add_dquot_ref(sb, type);
@@ -1470,7 +1470,7 @@ out_lock:
1470 inode->i_flags |= oldflags; 1470 inode->i_flags |= oldflags;
1471 up_write(&dqopt->dqptr_sem); 1471 up_write(&dqopt->dqptr_sem);
1472 } 1472 }
1473 up(&inode->i_sem); 1473 mutex_unlock(&inode->i_mutex);
1474out_fmt: 1474out_fmt:
1475 put_quota_format(fmt); 1475 put_quota_format(fmt);
1476 1476