Skip to content

Commit e2a3fde

Browse files
committed
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>
1 parent 67f1648 commit e2a3fde

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎fs/ext2/super.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,6 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
14341434
struct buffer_head tmp_bh;
14351435
struct buffer_head *bh;
14361436

1437-
mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
14381437
while (towrite > 0) {
14391438
tocopy = sb->s_blocksize - offset < towrite ?
14401439
sb->s_blocksize - offset : towrite;
@@ -1464,16 +1463,13 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
14641463
blk++;
14651464
}
14661465
out:
1467-
if (len == towrite) {
1468-
mutex_unlock(&inode->i_mutex);
1466+
if (len == towrite)
14691467
return err;
1470-
}
14711468
if (inode->i_size < off+len-towrite)
14721469
i_size_write(inode, off+len-towrite);
14731470
inode->i_version++;
14741471
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
14751472
mark_inode_dirty(inode);
1476-
mutex_unlock(&inode->i_mutex);
14771473
return len - towrite;
14781474
}
14791475

0 commit comments

Comments
 (0)