fuse: Don't wait forever in request_wait_answer()

Waiting for too long causes errors like this:

[ 2575.350286] Freezing of tasks aborted after 9.232 seconds
[ 2575.352547] Orange:0        D    0 19940    695 0x00000809
[ 2575.352577] Call trace:
[ 2575.352600] __switch_to+0x1c4/0x220
[ 2575.352610] __schedule.lto_priv.0+0x20c/0x6e0
[ 2575.352615] schedule+0x38/0x9c
[ 2575.352626] __fuse_request_send+0x228/0x3c0
[ 2575.352629] fuse_simple_request+0xe0/0x1d4
[ 2575.352634] fuse_lookup_name+0x128/0x2a8
[ 2575.352638] fuse_lookup.lto_priv.0+0x10c/0x1c0
[ 2575.352648] lookup_slow+0xd0/0x2b0
[ 2575.352651] walk_component+0x248/0x9ac
[ 2575.352655] path_lookupat.lto_priv.0+0x94/0x2e0
[ 2575.352664] SyS_faccessat+0x120/0x4cc
[ 2575.352671] __sys_trace_return+0x0/0x4

Change-Id: Ie12ac4f7307c1c436ca589d1df33f5cf2b4c8778
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
Yaroslav Furman 2021-03-07 21:03:44 +03:00 committed by Richard Raya
parent 0d3abd7a73
commit 4a013e3dd8

View File

@ -479,11 +479,11 @@ static void request_wait_answer(struct fuse_conn *fc, struct fuse_req *req)
/*
* Either request is already in userspace, or it was forced.
* Wait it out.
* Wait half of freeze_timeout_msecs to avoid getting stuck.
*/
while (!test_bit(FR_FINISHED, &req->flags))
wait_event_freezable(req->waitq,
test_bit(FR_FINISHED, &req->flags));
wait_event_freezable_timeout(req->waitq,
test_bit(FR_FINISHED, &req->flags), freeze_timeout_msecs / 2);
}
static void __fuse_request_send(struct fuse_conn *fc, struct fuse_req *req)