f2fs: return correct errno in f2fs_gc
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 25 Sep 2018 22:25:21 +0000 (15:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2019 08:53:18 +0000 (09:53 +0100)
[ Upstream commit 61f7725aa148ee870436a29d3a24d5c00ab7e9af ]

This fixes overriding error number in f2fs_gc.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/gc.c

index 759056e..b1d6200 100644 (file)
@@ -985,7 +985,7 @@ stop:
 
        put_gc_inode(&gc_list);
 
-       if (sync)
+       if (sync && !ret)
                ret = sec_freed ? 0 : -EAGAIN;
        return ret;
 }