]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: fix missing unlock(sbi->gc_mutex)
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 18 Dec 2018 01:08:26 +0000 (17:08 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jan 2019 16:46:01 +0000 (17:46 +0100)
commit 8f31b4665c14fe19593601a250275e58c7ad0ef1 upstream.

This fixes missing unlock call.

Cc: <stable@vger.kernel.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/super.c

index af58b2cc21b81ecafc73c550f5a8228dfaafe19a..b17dde1c3a28c634f4575487e022ac385f3019a3 100644 (file)
@@ -1457,19 +1457,16 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
 
        sbi->sb->s_flags |= SB_ACTIVE;
 
-       mutex_lock(&sbi->gc_mutex);
        f2fs_update_time(sbi, DISABLE_TIME);
 
        while (!f2fs_time_over(sbi, DISABLE_TIME)) {
+               mutex_lock(&sbi->gc_mutex);
                err = f2fs_gc(sbi, true, false, NULL_SEGNO);
                if (err == -ENODATA)
                        break;
-               if (err && err != -EAGAIN) {
-                       mutex_unlock(&sbi->gc_mutex);
+               if (err && err != -EAGAIN)
                        return err;
-               }
        }
-       mutex_unlock(&sbi->gc_mutex);
 
        err = sync_filesystem(sbi->sb);
        if (err)