Commit 8c85e125124a473d6f3e9bb187b0b84207f81d91
Committed by
Al Viro
1 parent
517bfae283
Exists in
master
and in
4 other branches
remove ->write_super call in generic_shutdown_super
We just did a full fs writeout using sync_filesystem before, and if that's not enough for the filesystem it can perform it's own writeout in ->put_super, which many filesystems already do. Move a call to foofs_write_super into every foofs_put_super for now to guarantee identical behaviour until it's cleaned up by the individual filesystem maintainers. Exceptions: - affs already has identical copy & pasted code at the beginning of affs_put_super so no need to do it twice. - xfs does the right thing without it and I have changes pending for the xfs tree touching this are so I don't really need conflicts here.. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 13 changed files with 36 additions and 2 deletions Side-by-side Diff
fs/bfs/inode.c
... | ... | @@ -30,6 +30,7 @@ |
30 | 30 | #define dprintf(x...) |
31 | 31 | #endif |
32 | 32 | |
33 | +static void bfs_write_super(struct super_block *s); | |
33 | 34 | void dump_imap(const char *prefix, struct super_block *s); |
34 | 35 | |
35 | 36 | struct inode *bfs_iget(struct super_block *sb, unsigned long ino) |
... | ... | @@ -215,6 +216,9 @@ |
215 | 216 | |
216 | 217 | if (!info) |
217 | 218 | return; |
219 | + | |
220 | + if (s->s_dirt) | |
221 | + bfs_write_super(s); | |
218 | 222 | |
219 | 223 | brelse(info->si_sbh); |
220 | 224 | mutex_destroy(&info->bfs_lock); |
fs/exofs/super.c
... | ... | @@ -258,6 +258,9 @@ |
258 | 258 | int num_pend; |
259 | 259 | struct exofs_sb_info *sbi = sb->s_fs_info; |
260 | 260 | |
261 | + if (sb->s_dirt) | |
262 | + exofs_write_super(sb); | |
263 | + | |
261 | 264 | /* make sure there are no pending commands */ |
262 | 265 | for (num_pend = atomic_read(&sbi->s_curr_pending); num_pend > 0; |
263 | 266 | num_pend = atomic_read(&sbi->s_curr_pending)) { |
fs/ext2/super.c
fs/ext4/super.c
fs/fat/inode.c
fs/hfs/super.c
fs/hfsplus/super.c
... | ... | @@ -199,6 +199,8 @@ |
199 | 199 | dprint(DBG_SUPER, "hfsplus_put_super\n"); |
200 | 200 | if (!sb->s_fs_info) |
201 | 201 | return; |
202 | + if (sb->s_dirt) | |
203 | + hfsplus_write_super(sb); | |
202 | 204 | if (!(sb->s_flags & MS_RDONLY) && HFSPLUS_SB(sb).s_vhdr) { |
203 | 205 | struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; |
204 | 206 |
fs/jffs2/super.c
fs/nilfs2/super.c
... | ... | @@ -65,6 +65,7 @@ |
65 | 65 | "(NILFS)"); |
66 | 66 | MODULE_LICENSE("GPL"); |
67 | 67 | |
68 | +static void nilfs_write_super(struct super_block *sb); | |
68 | 69 | static int nilfs_remount(struct super_block *sb, int *flags, char *data); |
69 | 70 | static int test_exclusive_mount(struct file_system_type *fs_type, |
70 | 71 | struct block_device *bdev, int flags); |
... | ... | @@ -314,6 +315,9 @@ |
314 | 315 | { |
315 | 316 | struct nilfs_sb_info *sbi = NILFS_SB(sb); |
316 | 317 | struct the_nilfs *nilfs = sbi->s_nilfs; |
318 | + | |
319 | + if (sb->s_dirt) | |
320 | + nilfs_write_super(sb); | |
317 | 321 | |
318 | 322 | nilfs_detach_segment_constructor(sbi); |
319 | 323 |
fs/reiserfs/super.c
... | ... | @@ -468,6 +468,9 @@ |
468 | 468 | struct reiserfs_transaction_handle th; |
469 | 469 | th.t_trans_id = 0; |
470 | 470 | |
471 | + if (s->s_dirt) | |
472 | + reiserfs_write_super(s); | |
473 | + | |
471 | 474 | /* change file system state to current state if it was mounted with read-write permissions */ |
472 | 475 | if (!(s->s_flags & MS_RDONLY)) { |
473 | 476 | if (!journal_begin(&th, s, 10)) { |
fs/super.c
fs/sysv/inode.c