]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: return success if there is no work to do
authorTom Rix <trix@redhat.com>
Sat, 15 May 2021 18:09:41 +0000 (11:09 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 26 May 2021 14:00:35 +0000 (07:00 -0700)
commita3896a0bd2d86f5e3ef78b6866158068b6a61946
tree467887f973b525c913b85f6bd986bbb5a6306c82
parent78a0a53998f76c7c83f24e13bac18f0cf59584c4
f2fs: return success if there is no work to do

Static analysis reports this problem
file.c:3206:2: warning: Undefined or garbage value returned to caller
        return err;
        ^~~~~~~~~~

err is only set if there is some work to do.  Because the loop returns
immediately on an error, if all the work was done, a 0 would be returned.
Instead of checking the unlikely case that there was no work to do,
change the return of err to 0.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c