Skip to content

Commit ece78b7

Browse files
committed
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
2 parents 07acfc2 + 0324876 commit ece78b7

19 files changed

Lines changed: 342 additions & 245 deletions

File tree

‎Documentation/filesystems/ext3.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ commit=nrsec (*) Ext3 can be told to sync all its data and metadata
5959
Setting it to very large values will improve
6060
performance.
6161

62-
barrier=<0(*)|1> This enables/disables the use of write barriers in
63-
barrier the jbd code. barrier=0 disables, barrier=1 enables.
64-
nobarrier (*) This also requires an IO stack which can support
62+
barrier=<0|1(*)> This enables/disables the use of write barriers in
63+
barrier (*) the jbd code. barrier=0 disables, barrier=1 enables.
64+
nobarrier This also requires an IO stack which can support
6565
barriers, and if jbd gets an error on a barrier
6666
write, it will disable again with a warning.
6767
Write barriers enforce proper on-disk ordering

‎fs/ext2/balloc.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ static void release_blocks(struct super_block *sb, int count)
165165
struct ext2_sb_info *sbi = EXT2_SB(sb);
166166

167167
percpu_counter_add(&sbi->s_freeblocks_counter, count);
168-
sb->s_dirt = 1;
169168
}
170169
}
171170

@@ -180,7 +179,6 @@ static void group_adjust_blocks(struct super_block *sb, int group_no,
180179
free_blocks = le16_to_cpu(desc->bg_free_blocks_count);
181180
desc->bg_free_blocks_count = cpu_to_le16(free_blocks + count);
182181
spin_unlock(sb_bgl_lock(sbi, group_no));
183-
sb->s_dirt = 1;
184182
mark_buffer_dirty(bh);
185183
}
186184
}
@@ -479,7 +477,7 @@ void ext2_discard_reservation(struct inode *inode)
479477
}
480478

481479
/**
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
483481
* @inode: inode
484482
* @block: start physcial block to free
485483
* @count: number of blocks to free

‎fs/ext2/ialloc.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ static void ext2_release_inode(struct super_block *sb, int group, int dir)
8181
spin_unlock(sb_bgl_lock(EXT2_SB(sb), group));
8282
if (dir)
8383
percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter);
84-
sb->s_dirt = 1;
8584
mark_buffer_dirty(bh);
8685
}
8786

@@ -543,7 +542,6 @@ struct inode *ext2_new_inode(struct inode *dir, umode_t mode,
543542
}
544543
spin_unlock(sb_bgl_lock(sbi, group));
545544

546-
sb->s_dirt = 1;
547545
mark_buffer_dirty(bh2);
548546
if (test_opt(sb, GRPID)) {
549547
inode->i_mode = mode;

‎fs/ext2/super.c‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ static void ext2_put_super (struct super_block * sb)
130130

131131
dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
132132

133-
if (sb->s_dirt)
134-
ext2_write_super(sb);
135-
136133
ext2_xattr_put_super(sb);
137134
if (!(sb->s_flags & MS_RDONLY)) {
138135
struct ext2_super_block *es = sbi->s_es;
@@ -307,7 +304,6 @@ static const struct super_operations ext2_sops = {
307304
.write_inode = ext2_write_inode,
308305
.evict_inode = ext2_evict_inode,
309306
.put_super = ext2_put_super,
310-
.write_super = ext2_write_super,
311307
.sync_fs = ext2_sync_fs,
312308
.statfs = ext2_statfs,
313309
.remount_fs = ext2_remount,
@@ -358,11 +354,6 @@ static struct dentry *ext2_fh_to_parent(struct super_block *sb, struct fid *fid,
358354
ext2_nfs_get_inode);
359355
}
360356

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-
*/
366357
static const struct export_operations ext2_export_ops = {
367358
.fh_to_dentry = ext2_fh_to_dentry,
368359
.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,
11761167
mark_buffer_dirty(EXT2_SB(sb)->s_sbh);
11771168
if (wait)
11781169
sync_dirty_buffer(EXT2_SB(sb)->s_sbh);
1179-
sb->s_dirt = 0;
11801170
}
11811171

11821172
/*
@@ -1209,8 +1199,6 @@ void ext2_write_super(struct super_block *sb)
12091199
{
12101200
if (!(sb->s_flags & MS_RDONLY))
12111201
ext2_sync_fs(sb, 1);
1212-
else
1213-
sb->s_dirt = 0;
12141202
}
12151203

12161204
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,
14561444
struct buffer_head tmp_bh;
14571445
struct buffer_head *bh;
14581446

1459-
mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
14601447
while (towrite > 0) {
14611448
tocopy = sb->s_blocksize - offset < towrite ?
14621449
sb->s_blocksize - offset : towrite;
@@ -1486,16 +1473,13 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
14861473
blk++;
14871474
}
14881475
out:
1489-
if (len == towrite) {
1490-
mutex_unlock(&inode->i_mutex);
1476+
if (len == towrite)
14911477
return err;
1492-
}
14931478
if (inode->i_size < off+len-towrite)
14941479
i_size_write(inode, off+len-towrite);
14951480
inode->i_version++;
14961481
inode->i_mtime = inode->i_ctime = CURRENT_TIME;
14971482
mark_inode_dirty(inode);
1498-
mutex_unlock(&inode->i_mutex);
14991483
return len - towrite;
15001484
}
15011485

‎fs/ext2/xattr.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ static void ext2_xattr_update_super_block(struct super_block *sb)
339339
spin_lock(&EXT2_SB(sb)->s_lock);
340340
EXT2_SET_COMPAT_FEATURE(sb, EXT2_FEATURE_COMPAT_EXT_ATTR);
341341
spin_unlock(&EXT2_SB(sb)->s_lock);
342-
sb->s_dirt = 1;
343342
mark_buffer_dirty(EXT2_SB(sb)->s_sbh);
344343
}
345344

0 commit comments

Comments
 (0)