f2fs: make sure f2fs_gc returns consistent errno
authorWeichao Guo <guoweichao@huawei.com>
Wed, 10 May 2017 20:28:00 +0000 (04:28 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 24 May 2017 04:05:35 +0000 (21:05 -0700)
commite5dbd9563e5528f98728ba0bc8361f804ace5aae
tree95459c262c75c126ff9cce57b9609632e0f9b4f9
parent1c6d8ee4b8aaadc3645497658007ca007312351d
f2fs: make sure f2fs_gc returns consistent errno

By default, f2fs_gc returns -EINVAL in general error cases, e.g., no victim
was selected. However, the default errno may be overwritten in two cases:
gc_more and BG_GC -> FG_GC. We should return consistent errno in such cases.

Signed-off-by: Weichao Guo <guoweichao@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/gc.c