aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ufs/super.c')
-rw-r--r--fs/ufs/super.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 54828ebcf1ba..e9a42c711a9e 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1275,7 +1275,7 @@ static ssize_t ufs_quota_write(struct super_block *sb, int type,
1275 size_t towrite = len; 1275 size_t towrite = len;
1276 struct buffer_head *bh; 1276 struct buffer_head *bh;
1277 1277
1278 down(&inode->i_sem); 1278 mutex_lock(&inode->i_mutex);
1279 while (towrite > 0) { 1279 while (towrite > 0) {
1280 tocopy = sb->s_blocksize - offset < towrite ? 1280 tocopy = sb->s_blocksize - offset < towrite ?
1281 sb->s_blocksize - offset : towrite; 1281 sb->s_blocksize - offset : towrite;
@@ -1296,14 +1296,16 @@ static ssize_t ufs_quota_write(struct super_block *sb, int type,
1296 blk++; 1296 blk++;
1297 } 1297 }
1298out: 1298out:
1299 if (len == towrite) 1299 if (len == towrite) {
1300 mutex_unlock(&inode->i_mutex);
1300 return err; 1301 return err;
1302 }
1301 if (inode->i_size < off+len-towrite) 1303 if (inode->i_size < off+len-towrite)
1302 i_size_write(inode, off+len-towrite); 1304 i_size_write(inode, off+len-towrite);
1303 inode->i_version++; 1305 inode->i_version++;
1304 inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; 1306 inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC;
1305 mark_inode_dirty(inode); 1307 mark_inode_dirty(inode);
1306 up(&inode->i_sem); 1308 mutex_unlock(&inode->i_mutex);
1307 return len - towrite; 1309 return len - towrite;
1308} 1310}
1309 1311