summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4_jbd2.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2020-12-16 11:18:39 +0100
committerTheodore Ts'o <tytso@mit.edu>2020-12-22 19:08:46 +0100
commit05c2c00f3769abb9e323fcaca70d2de0b48af7ba (patch)
tree503246bd2db7415e5552acbca2126f4a7e2a8c07 /fs/ext4/ext4_jbd2.c
parentext4: drop sync argument of ext4_commit_super() (diff)
downloadlinux-05c2c00f3769abb9e323fcaca70d2de0b48af7ba.tar.xz
linux-05c2c00f3769abb9e323fcaca70d2de0b48af7ba.zip
ext4: protect superblock modifications with a buffer lock
Protect all superblock modifications (including checksum computation) with a superblock buffer lock. That way we are sure computed checksum matches current superblock contents (a mismatch could cause checksum failures in nojournal mode or if an unjournalled superblock update races with a journalled one). Also we avoid modifying superblock contents while it is being written out (which can cause DIF/DIX failures if we are running in nojournal mode). Signed-off-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20201216101844.22917-4-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4_jbd2.c')
-rw-r--r--fs/ext4/ext4_jbd2.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index 1a0a827a7f34..c7e410c4ab7d 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -379,7 +379,6 @@ int __ext4_handle_dirty_super(const char *where, unsigned int line,
struct buffer_head *bh = EXT4_SB(sb)->s_sbh;
int err = 0;
- ext4_superblock_csum_set(sb);
if (ext4_handle_valid(handle)) {
err = jbd2_journal_dirty_metadata(handle, bh);
if (err)