ext3: Remove i_mutex use from ext3_quota_write()

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>
This commit is contained in:
Jan Kara 2012-04-25 21:24:30 +02:00
Родитель d7e9711760
Коммит 905c393762
1 изменённых файлов: 1 добавлений и 5 удалений

Просмотреть файл

@ -3000,7 +3000,6 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type,
(unsigned long long)off, (unsigned long long)len); (unsigned long long)off, (unsigned long long)len);
return -EIO; return -EIO;
} }
mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
bh = ext3_bread(handle, inode, blk, 1, &err); bh = ext3_bread(handle, inode, blk, 1, &err);
if (!bh) if (!bh)
goto out; goto out;
@ -3024,10 +3023,8 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type,
} }
brelse(bh); brelse(bh);
out: out:
if (err) { if (err)
mutex_unlock(&inode->i_mutex);
return err; return err;
}
if (inode->i_size < off + len) { if (inode->i_size < off + len) {
i_size_write(inode, off + len); i_size_write(inode, off + len);
EXT3_I(inode)->i_disksize = inode->i_size; EXT3_I(inode)->i_disksize = inode->i_size;
@ -3035,7 +3032,6 @@ out:
inode->i_version++; inode->i_version++;
inode->i_mtime = inode->i_ctime = CURRENT_TIME; inode->i_mtime = inode->i_ctime = CURRENT_TIME;
ext3_mark_inode_dirty(handle, inode); ext3_mark_inode_dirty(handle, inode);
mutex_unlock(&inode->i_mutex);
return len; return len;
} }