aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests
diff options
context:
space:
mode:
authorJosef Bacik <[email protected]>2019-03-07 21:37:18 +0000
committerJens Axboe <[email protected]>2019-07-10 09:00:57 -0600
commitb554db147feea39617b533ab6bca247c91c6198a (patch)
tree2041b2db3c965062f63d0315af213f385d3ccbd0 /tools/testing/selftests/bpf/prog_tests
parentcdc5ffc4100549654e19e6f068cf1fc0871a85c2 (diff)
block: init flush rq ref count to 1
We discovered a problem in newer kernels where a disconnect of a NBD device while the flush request was pending would result in a hang. This is because the blk mq timeout handler does if (!refcount_inc_not_zero(&rq->ref)) return true; to determine if it's ok to run the timeout handler for the request. Flush_rq's don't have a ref count set, so we'd skip running the timeout handler for this request and it would just sit there in limbo forever. Fix this by always setting the refcount of any request going through blk_init_rq() to 1. I tested this with a nbd-server that dropped flush requests to verify that it hung, and then tested with this patch to verify I got the timeout as expected and the error handling kicked in. Thanks, Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests')
0 files changed, 0 insertions, 0 deletions