diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-25 11:14:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-25 11:14:59 -0400 |
commit | ece78b7df734726e790dcab207f463401ff80440 (patch) | |
tree | 4a0b23c28c6a727d5eebc8a88a22fe3720c425fd /fs/ext2 | |
parent | 07acfc2a9349a8ce45b236c2624dad452001966b (diff) | |
parent | 0324876628a9c7faf8127e20af29373dc6dec876 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull ext2, ext3 and quota fixes from Jan Kara:
"Interesting bits are:
- removal of a special i_mutex locking subclass (I_MUTEX_QUOTA) since
quota code does not need i_mutex anymore in any unusual way.
- backport (from ext4) of a fix of a checkpointing bug (missing cache
flush) that could lead to fs corruption on power failure
The rest are just random small fixes & cleanups."
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
ext2: trivial fix to comment for ext2_free_blocks
ext2: remove the redundant comment for ext2_export_ops
ext3: return 32/64-bit dir name hash according to usage type
quota: Get rid of nested I_MUTEX_QUOTA locking subclass
quota: Use precomputed value of sb_dqopt in dquot_quota_sync
ext2: Remove i_mutex use from ext2_quota_write()
reiserfs: Remove i_mutex use from reiserfs_quota_write()
ext4: Remove i_mutex use from ext4_quota_write()
ext3: Remove i_mutex use from ext3_quota_write()
quota: Fix double lock in add_dquot_ref() with CONFIG_QUOTA_DEBUG
jbd: Write journal superblock with WRITE_FUA after checkpointing
jbd: protect all log tail updates with j_checkpoint_mutex
jbd: Split updating of journal superblock and marking journal empty
ext2: do not register write_super within VFS
ext2: Remove s_dirt handling
ext2: write superblock only once on unmount
ext3: update documentation with barrier=1 default
ext3: remove max_debt in find_group_orlov()
jbd: Refine commit writeout logic
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/balloc.c | 4 | ||||
-rw-r--r-- | fs/ext2/ialloc.c | 2 | ||||
-rw-r--r-- | fs/ext2/super.c | 18 | ||||
-rw-r--r-- | fs/ext2/xattr.c | 1 |
4 files changed, 2 insertions, 23 deletions
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index 030c6d277e14..1c3613998862 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c | |||
@@ -165,7 +165,6 @@ static void release_blocks(struct super_block *sb, int count) | |||
165 | struct ext2_sb_info *sbi = EXT2_SB(sb); | 165 | struct ext2_sb_info *sbi = EXT2_SB(sb); |
166 | 166 | ||
167 | percpu_counter_add(&sbi->s_freeblocks_counter, count); | 167 | percpu_counter_add(&sbi->s_freeblocks_counter, count); |
168 | sb->s_dirt = 1; | ||
169 | } | 168 | } |
170 | } | 169 | } |
171 | 170 | ||
@@ -180,7 +179,6 @@ static void group_adjust_blocks(struct super_block *sb, int group_no, | |||
180 | free_blocks = le16_to_cpu(desc->bg_free_blocks_count); | 179 | free_blocks = le16_to_cpu(desc->bg_free_blocks_count); |
181 | desc->bg_free_blocks_count = cpu_to_le16(free_blocks + count); | 180 | desc->bg_free_blocks_count = cpu_to_le16(free_blocks + count); |
182 | spin_unlock(sb_bgl_lock(sbi, group_no)); | 181 | spin_unlock(sb_bgl_lock(sbi, group_no)); |
183 | sb->s_dirt = 1; | ||
184 | mark_buffer_dirty(bh); | 182 | mark_buffer_dirty(bh); |
185 | } | 183 | } |
186 | } | 184 | } |
@@ -479,7 +477,7 @@ void ext2_discard_reservation(struct inode *inode) | |||
479 | } | 477 | } |
480 | 478 | ||
481 | /** | 479 | /** |
482 | * ext2_free_blocks_sb() -- Free given blocks and update quota and i_blocks | 480 | * ext2_free_blocks() -- Free given blocks and update quota and i_blocks |
483 | * @inode: inode | 481 | * @inode: inode |
484 | * @block: start physcial block to free | 482 | * @block: start physcial block to free |
485 | * @count: number of blocks to free | 483 | * @count: number of blocks to free |
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index 8b15cf8cef37..c13eb7b91a11 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c | |||
@@ -81,7 +81,6 @@ static void ext2_release_inode(struct super_block *sb, int group, int dir) | |||
81 | spin_unlock(sb_bgl_lock(EXT2_SB(sb), group)); | 81 | spin_unlock(sb_bgl_lock(EXT2_SB(sb), group)); |
82 | if (dir) | 82 | if (dir) |
83 | percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter); | 83 | percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter); |
84 | sb->s_dirt = 1; | ||
85 | mark_buffer_dirty(bh); | 84 | mark_buffer_dirty(bh); |
86 | } | 85 | } |
87 | 86 | ||
@@ -543,7 +542,6 @@ got: | |||
543 | } | 542 | } |
544 | spin_unlock(sb_bgl_lock(sbi, group)); | 543 | spin_unlock(sb_bgl_lock(sbi, group)); |
545 | 544 | ||
546 | sb->s_dirt = 1; | ||
547 | mark_buffer_dirty(bh2); | 545 | mark_buffer_dirty(bh2); |
548 | if (test_opt(sb, GRPID)) { | 546 | if (test_opt(sb, GRPID)) { |
549 | inode->i_mode = mode; | 547 | inode->i_mode = mode; |
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 38f816071ddb..b3621cb7ea31 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -130,9 +130,6 @@ static void ext2_put_super (struct super_block * sb) | |||
130 | 130 | ||
131 | dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); | 131 | dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); |
132 | 132 | ||
133 | if (sb->s_dirt) | ||
134 | ext2_write_super(sb); | ||
135 | |||
136 | ext2_xattr_put_super(sb); | 133 | ext2_xattr_put_super(sb); |
137 | if (!(sb->s_flags & MS_RDONLY)) { | 134 | if (!(sb->s_flags & MS_RDONLY)) { |
138 | struct ext2_super_block *es = sbi->s_es; | 135 | struct ext2_super_block *es = sbi->s_es; |
@@ -307,7 +304,6 @@ static const struct super_operations ext2_sops = { | |||
307 | .write_inode = ext2_write_inode, | 304 | .write_inode = ext2_write_inode, |
308 | .evict_inode = ext2_evict_inode, | 305 | .evict_inode = ext2_evict_inode, |
309 | .put_super = ext2_put_super, | 306 | .put_super = ext2_put_super, |
310 | .write_super = ext2_write_super, | ||
311 | .sync_fs = ext2_sync_fs, | 307 | .sync_fs = ext2_sync_fs, |
312 | .statfs = ext2_statfs, | 308 | .statfs = ext2_statfs, |
313 | .remount_fs = ext2_remount, | 309 | .remount_fs = ext2_remount, |
@@ -358,11 +354,6 @@ static struct dentry *ext2_fh_to_parent(struct super_block *sb, struct fid *fid, | |||
358 | ext2_nfs_get_inode); | 354 | ext2_nfs_get_inode); |
359 | } | 355 | } |
360 | 356 | ||
361 | /* Yes, most of these are left as NULL!! | ||
362 | * A NULL value implies the default, which works with ext2-like file | ||
363 | * systems, but can be improved upon. | ||
364 | * Currently only get_parent is required. | ||
365 | */ | ||
366 | static const struct export_operations ext2_export_ops = { | 357 | static const struct export_operations ext2_export_ops = { |
367 | .fh_to_dentry = ext2_fh_to_dentry, | 358 | .fh_to_dentry = ext2_fh_to_dentry, |
368 | .fh_to_parent = ext2_fh_to_parent, | 359 | .fh_to_parent = ext2_fh_to_parent, |
@@ -1176,7 +1167,6 @@ static void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es, | |||
1176 | mark_buffer_dirty(EXT2_SB(sb)->s_sbh); | 1167 | mark_buffer_dirty(EXT2_SB(sb)->s_sbh); |
1177 | if (wait) | 1168 | if (wait) |
1178 | sync_dirty_buffer(EXT2_SB(sb)->s_sbh); | 1169 | sync_dirty_buffer(EXT2_SB(sb)->s_sbh); |
1179 | sb->s_dirt = 0; | ||
1180 | } | 1170 | } |
1181 | 1171 | ||
1182 | /* | 1172 | /* |
@@ -1209,8 +1199,6 @@ void ext2_write_super(struct super_block *sb) | |||
1209 | { | 1199 | { |
1210 | if (!(sb->s_flags & MS_RDONLY)) | 1200 | if (!(sb->s_flags & MS_RDONLY)) |
1211 | ext2_sync_fs(sb, 1); | 1201 | ext2_sync_fs(sb, 1); |
1212 | else | ||
1213 | sb->s_dirt = 0; | ||
1214 | } | 1202 | } |
1215 | 1203 | ||
1216 | static int ext2_remount (struct super_block * sb, int * flags, char * data) | 1204 | static int ext2_remount (struct super_block * sb, int * flags, char * data) |
@@ -1456,7 +1444,6 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type, | |||
1456 | struct buffer_head tmp_bh; | 1444 | struct buffer_head tmp_bh; |
1457 | struct buffer_head *bh; | 1445 | struct buffer_head *bh; |
1458 | 1446 | ||
1459 | mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA); | ||
1460 | while (towrite > 0) { | 1447 | while (towrite > 0) { |
1461 | tocopy = sb->s_blocksize - offset < towrite ? | 1448 | tocopy = sb->s_blocksize - offset < towrite ? |
1462 | sb->s_blocksize - offset : towrite; | 1449 | sb->s_blocksize - offset : towrite; |
@@ -1486,16 +1473,13 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type, | |||
1486 | blk++; | 1473 | blk++; |
1487 | } | 1474 | } |
1488 | out: | 1475 | out: |
1489 | if (len == towrite) { | 1476 | if (len == towrite) |
1490 | mutex_unlock(&inode->i_mutex); | ||
1491 | return err; | 1477 | return err; |
1492 | } | ||
1493 | if (inode->i_size < off+len-towrite) | 1478 | if (inode->i_size < off+len-towrite) |
1494 | i_size_write(inode, off+len-towrite); | 1479 | i_size_write(inode, off+len-towrite); |
1495 | inode->i_version++; | 1480 | inode->i_version++; |
1496 | inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 1481 | inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
1497 | mark_inode_dirty(inode); | 1482 | mark_inode_dirty(inode); |
1498 | mutex_unlock(&inode->i_mutex); | ||
1499 | return len - towrite; | 1483 | return len - towrite; |
1500 | } | 1484 | } |
1501 | 1485 | ||
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index 6dcafc7efdfd..b6754dbbce3c 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c | |||
@@ -339,7 +339,6 @@ static void ext2_xattr_update_super_block(struct super_block *sb) | |||
339 | spin_lock(&EXT2_SB(sb)->s_lock); | 339 | spin_lock(&EXT2_SB(sb)->s_lock); |
340 | EXT2_SET_COMPAT_FEATURE(sb, EXT2_FEATURE_COMPAT_EXT_ATTR); | 340 | EXT2_SET_COMPAT_FEATURE(sb, EXT2_FEATURE_COMPAT_EXT_ATTR); |
341 | spin_unlock(&EXT2_SB(sb)->s_lock); | 341 | spin_unlock(&EXT2_SB(sb)->s_lock); |
342 | sb->s_dirt = 1; | ||
343 | mark_buffer_dirty(EXT2_SB(sb)->s_sbh); | 342 | mark_buffer_dirty(EXT2_SB(sb)->s_sbh); |
344 | } | 343 | } |
345 | 344 | ||