summaryrefslogtreecommitdiffstats
path: root/fs/squashfs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2019-02-14 16:27:14 -0500
committerTheodore Ts'o <tytso@mit.edu>2019-02-14 16:27:14 -0500
commit538bcaa6261b77e71d37f5596c33127c1a3ec3f7 (patch)
treec6e4ab8e25697940e42ff620ad2d4d2413bcc639 /fs/squashfs
parentf96c3ac8dfc24b4e38fc4c2eba5fea2107b929d1 (diff)
downloadlinux-538bcaa6261b77e71d37f5596c33127c1a3ec3f7.tar.bz2
jbd2: fix race when writing superblock
The jbd2 superblock is lockless now, so there is probably a race condition between writing it so disk and modifing contents of it, which may lead to checksum error. The following race is the one case that we have captured. jbd2 fsstress jbd2_journal_commit_transaction jbd2_journal_update_sb_log_tail jbd2_write_superblock jbd2_superblock_csum_set jbd2_journal_revoke jbd2_journal_set_features(revork) modify superblock submit_bh(checksum incorrect) Fix this by locking the buffer head before modifing it. We always write the jbd2 superblock after we modify it, so this just means calling the lock_buffer() a little earlier. This checksum corruption problem can be reproduced by xfstests generic/475. Reported-by: zhangyi (F) <yi.zhang@huawei.com> Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/squashfs')
0 files changed, 0 insertions, 0 deletions