f2fs: report the discard cmd errors properly
authorSahitya Tummala <stummala@codeaurora.org>
Wed, 15 Apr 2020 04:05:54 +0000 (09:35 +0530)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 17 Apr 2020 16:17:00 +0000 (09:17 -0700)
commit3fa6a8c5b55d063c6a759e0b354f9d7fc09ffbc0
treed55cb1cf7d1c9bf321eac927d0aa95e65aa2b119
parent141af6ba5216d4d49de683582b600d5c9b51792c
f2fs: report the discard cmd errors properly

In case a discard_cmd is split into several bios, the dc->error
must not be overwritten once an error is reported by a bio. Also,
move it under dc->lock.

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