diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 3f6985fa5a460a73a90ee26c3ff273edd867aa32..c6cac2d40f710b70fad419a49065b5b67f21f3a1 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -1096,7 +1096,10 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) err = ext4_journal_get_write_access(handle, sbi->s_sbh); if (err) goto pwsalt_err_journal; + lock_buffer(sbi->s_sbh); generate_random_uuid(sbi->s_es->s_encrypt_pw_salt); + ext4_superblock_csum_set(sb); + unlock_buffer(sbi->s_sbh); err = ext4_handle_dirty_metadata(handle, NULL, sbi->s_sbh); pwsalt_err_journal: