Commit e2a3fde75079efeb22cf1e5098d5689b664bf1d5
1 parent
67f1648d21
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 1 changed file with 1 additions and 5 deletions Side-by-side Diff
fs/ext2/super.c
... | ... | @@ -1434,7 +1434,6 @@ |
1434 | 1434 | struct buffer_head tmp_bh; |
1435 | 1435 | struct buffer_head *bh; |
1436 | 1436 | |
1437 | - mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA); | |
1438 | 1437 | while (towrite > 0) { |
1439 | 1438 | tocopy = sb->s_blocksize - offset < towrite ? |
1440 | 1439 | sb->s_blocksize - offset : towrite; |
1441 | 1440 | |
1442 | 1441 | |
... | ... | @@ -1464,16 +1463,13 @@ |
1464 | 1463 | blk++; |
1465 | 1464 | } |
1466 | 1465 | out: |
1467 | - if (len == towrite) { | |
1468 | - mutex_unlock(&inode->i_mutex); | |
1466 | + if (len == towrite) | |
1469 | 1467 | return err; |
1470 | - } | |
1471 | 1468 | if (inode->i_size < off+len-towrite) |
1472 | 1469 | i_size_write(inode, off+len-towrite); |
1473 | 1470 | inode->i_version++; |
1474 | 1471 | inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
1475 | 1472 | mark_inode_dirty(inode); |
1476 | - mutex_unlock(&inode->i_mutex); | |
1477 | 1473 | return len - towrite; |
1478 | 1474 | } |
1479 | 1475 |