提交 ea212a4a 编写于 作者: J Jaegeuk Kim

f2fs: use lock_buffer when changing superblock

When modifying sb contents, we need to use lock its buffer.
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
上级 5d909cdb
......@@ -1591,14 +1591,18 @@ static int f2fs_ioc_get_encryption_pwsalt(struct file *filp, unsigned long arg)
return err;
/* update superblock with uuid */
lock_buffer(sbi->raw_super_buf);
generate_random_uuid(sbi->raw_super->encrypt_pw_salt);
unlock_buffer(sbi->raw_super_buf);
err = f2fs_commit_super(sbi, false);
mnt_drop_write_file(filp);
if (err) {
/* undo new data */
lock_buffer(sbi->raw_super_buf);
memset(sbi->raw_super->encrypt_pw_salt, 0, 16);
unlock_buffer(sbi->raw_super_buf);
return err;
}
got_it:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册