aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/super.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2012-04-25 15:29:42 -0400
committerJan Kara <jack@suse.cz>2012-05-15 17:34:38 -0400
commite2a3fde75079efeb22cf1e5098d5689b664bf1d5 (patch)
tree2e48dcc173ac5b6c5da67d97f50b88391f5d0efe /fs/ext2/super.c
parent67f1648d217c3b8165ca114c7838164f31e15790 (diff)
ext2: Remove i_mutex use from ext2_quota_write()
We don't need i_mutex in ext2_quota_write() because writes to quota file are serialized by dqio_mutex anyway. Changes to quota files outside of quota code are forbidded and enforced by NOATIME and IMMUTABLE bits. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext2/super.c')
-rw-r--r--fs/ext2/super.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index e0e8f45e9a71..7c1207c0e0c1 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1434,7 +1434,6 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
1434 struct buffer_head tmp_bh; 1434 struct buffer_head tmp_bh;
1435 struct buffer_head *bh; 1435 struct buffer_head *bh;
1436 1436
1437 mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
1438 while (towrite > 0) { 1437 while (towrite > 0) {
1439 tocopy = sb->s_blocksize - offset < towrite ? 1438 tocopy = sb->s_blocksize - offset < towrite ?
1440 sb->s_blocksize - offset : towrite; 1439 sb->s_blocksize - offset : towrite;
@@ -1464,16 +1463,13 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
1464 blk++; 1463 blk++;
1465 } 1464 }
1466out: 1465out:
1467 if (len == towrite) { 1466 if (len == towrite)
1468 mutex_unlock(&inode->i_mutex);
1469 return err; 1467 return err;
1470 }
1471 if (inode->i_size < off+len-towrite) 1468 if (inode->i_size < off+len-towrite)
1472 i_size_write(inode, off+len-towrite); 1469 i_size_write(inode, off+len-towrite);
1473 inode->i_version++; 1470 inode->i_version++;
1474 inode->i_mtime = inode->i_ctime = CURRENT_TIME; 1471 inode->i_mtime = inode->i_ctime = CURRENT_TIME;
1475 mark_inode_dirty(inode); 1472 mark_inode_dirty(inode);
1476 mutex_unlock(&inode->i_mutex);
1477 return len - towrite; 1473 return len - towrite;
1478} 1474}
1479 1475