| From: Chao Yu <yuchao0@huawei.com> |
| Date: Fri, 19 May 2017 23:46:44 +0800 |
| Subject: [PATCH] f2fs: wake up all waiters in f2fs_submit_discard_endio |
| References: bnc#1060662 |
| Patch-mainline: v4.12.4 |
| Git-commit: e31b98215779e66a490471c6ad886ae231316699 |
| |
| commit e31b98215779e66a490471c6ad886ae231316699 upstream. |
| |
| There could be more than one waiter waiting discard IO completion, so we |
| need use complete_all() instead of complete() in f2fs_submit_discard_endio |
| to avoid hungtask. |
| |
| Fixes: ec9895add2c5 ("f2fs: don't hold cmd_lock during waiting discard |
| command") |
| Signed-off-by: Chao Yu <yuchao0@huawei.com> |
| Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Signed-off-by: Jiri Slaby <jslaby@suse.cz> |
| |
| fs/f2fs/segment.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c |
| index 96845854e7ee..e7bfde80f665 100644 |
| |
| |
| @@ -751,7 +751,7 @@ static void f2fs_submit_discard_endio(struct bio *bio) |
| |
| dc->error = bio->bi_error; |
| dc->state = D_DONE; |
| - complete(&dc->wait); |
| + complete_all(&dc->wait); |
| bio_put(bio); |
| } |
| |
| -- |
| 2.14.2 |
| |