mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
f2fs: use lock_buffer when changing superblock
When modifying sb contents, we need to use lock its buffer. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
672830367a
commit
ae654a8d46
1 changed files with 4 additions and 0 deletions
|
@ -1611,14 +1611,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:
|
||||
|
|
Loading…
Reference in a new issue