f2fs: prevent waiter encountering incorrect discard states
authorChao Yu <yuchao0@huawei.com>
Wed, 5 Apr 2017 10:26:26 +0000 (18:26 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 11 Apr 2017 02:48:09 +0000 (19:48 -0700)
commitfa64a0036cb69c50ac156a841f1b83ef0f84fc16
treee9de1f47e853aabf53d9baa042b34b6f556e2400
parentd431413f00319919ed2adac0d58225160bd1d8fb
f2fs: prevent waiter encountering incorrect discard states

In f2fs_submit_discard_endio, we will wake up waiter before setting
discard command states, so waiter may use incorrect states. Change
the order between complete() and states setting to fix this issue.

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