]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix to return success when trimming meta area
authorChao Yu <yuchao0@huawei.com>
Wed, 8 Aug 2018 09:36:29 +0000 (17:36 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 13 Aug 2018 17:48:17 +0000 (10:48 -0700)
commit26c5d1eef0b3fac1fa4c101bf8bb8a94630ce46a
treecf9e6c6d502814f883d59548226c095af16dcfa4
parent83f8646061ef9afef7d8f3952f7638004b2fb63a
f2fs: fix to return success when trimming meta area

generic/251
    --- tests/generic/251.out 2016-05-03 20:20:11.381899000 +0800
     QA output created by 251
     Running the test: done.
    +fstrim: /mnt/scratch_f2fs: FITRIM ioctl failed: Invalid argument
    +fstrim: /mnt/scratch_f2fs: FITRIM ioctl failed: Invalid argument
    +fstrim: /mnt/scratch_f2fs: FITRIM ioctl failed: Invalid argument
    +fstrim: /mnt/scratch_f2fs: FITRIM ioctl failed: Invalid argument
    +fstrim: /mnt/scratch_f2fs: FITRIM ioctl failed: Invalid argument
    ...
Ran: generic/251
Failures: generic/251

The reason is coverage of fstrim locates in meta area, previously we
just return -EINVAL for such case, making generic/251 failed, to fix
this problem, let's relieve restriction to return success with no
block discarded.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c