diff options
Diffstat (limited to 'fs/ext4/ext4_jbd2.c')
-rw-r--r-- | fs/ext4/ext4_jbd2.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c index aca179017582..90f7c2e84db1 100644 --- a/fs/ext4/ext4_jbd2.c +++ b/fs/ext4/ext4_jbd2.c | |||
@@ -138,16 +138,23 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line, | |||
138 | } | 138 | } |
139 | 139 | ||
140 | int __ext4_handle_dirty_super(const char *where, unsigned int line, | 140 | int __ext4_handle_dirty_super(const char *where, unsigned int line, |
141 | handle_t *handle, struct super_block *sb) | 141 | handle_t *handle, struct super_block *sb, |
142 | int now) | ||
142 | { | 143 | { |
143 | struct buffer_head *bh = EXT4_SB(sb)->s_sbh; | 144 | struct buffer_head *bh = EXT4_SB(sb)->s_sbh; |
144 | int err = 0; | 145 | int err = 0; |
145 | 146 | ||
146 | if (ext4_handle_valid(handle)) { | 147 | if (ext4_handle_valid(handle)) { |
148 | ext4_superblock_csum_set(sb, | ||
149 | (struct ext4_super_block *)bh->b_data); | ||
147 | err = jbd2_journal_dirty_metadata(handle, bh); | 150 | err = jbd2_journal_dirty_metadata(handle, bh); |
148 | if (err) | 151 | if (err) |
149 | ext4_journal_abort_handle(where, line, __func__, | 152 | ext4_journal_abort_handle(where, line, __func__, |
150 | bh, handle, err); | 153 | bh, handle, err); |
154 | } else if (now) { | ||
155 | ext4_superblock_csum_set(sb, | ||
156 | (struct ext4_super_block *)bh->b_data); | ||
157 | mark_buffer_dirty(bh); | ||
151 | } else | 158 | } else |
152 | sb->s_dirt = 1; | 159 | sb->s_dirt = 1; |
153 | return err; | 160 | return err; |