From d0d3f1b329b01a9e16609eeadcc6d4fae0afc7c8 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Sun, 11 Feb 2018 22:53:20 +0800 Subject: f2fs: introduce sb_lock to make encrypt pwsalt update exclusive f2fs_super_block.encrypt_pw_salt can be udpated and persisted concurrently, result in getting different pwsalt in separated threads, so let's introduce sb_lock to exclude concurrent accessers. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/super.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs/f2fs/super.c') diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index ff6da6e05ec9..d2833a232528 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2221,6 +2221,8 @@ static void init_sb_info(struct f2fs_sb_info *sbi) sbi->dirty_device = 0; spin_lock_init(&sbi->dev_lock); + + mutex_init(&sbi->sb_lock); } static int init_percpu_info(struct f2fs_sb_info *sbi) -- cgit v1.2.3