Skip to content

Commit

Permalink
ext3: Remove i_mutex use from ext3_quota_write()
Browse files Browse the repository at this point in the history
We don't need i_mutex in ext3_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>
  • Loading branch information
Jan Kara committed May 15, 2012
1 parent d7e9711 commit 905c393
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/ext3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -3000,7 +3000,6 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type,
(unsigned long long)off, (unsigned long long)len);
return -EIO;
}
mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
bh = ext3_bread(handle, inode, blk, 1, &err);
if (!bh)
goto out;
Expand All @@ -3024,18 +3023,15 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type,
}
brelse(bh);
out:
if (err) {
mutex_unlock(&inode->i_mutex);
if (err)
return err;
}
if (inode->i_size < off + len) {
i_size_write(inode, off + len);
EXT3_I(inode)->i_disksize = inode->i_size;
}
inode->i_version++;
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
ext3_mark_inode_dirty(handle, inode);
mutex_unlock(&inode->i_mutex);
return len;
}

Expand Down

0 comments on commit 905c393

Please sign in to comment.