lkml.org 
[lkml]   [2015]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] f2fs: use lock_buffer when changing superblock
Date
When modifying sb contents, we need to use lock its buffer.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/file.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index a018ed3..a16dfe9 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1591,7 +1591,9 @@ 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);

--
2.4.9 (Apple Git-60)


\
 
 \ /
  Last update: 2015-12-08 00:21    [W:0.086 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site