diff options
author | Roland Dreier <roland@purestorage.com> | 2012-11-22 14:00:11 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-12 03:10:06 +0400 |
commit | 0ef4c881e4ade7a45174d9cf45eca6f9e10f5ccc (patch) | |
tree | 36131ba5152ad6b4fb076541076a2d386393e363 /fs/ext4/indirect.c | |
parent | 50e97121b728014dfbc34f07d1ac5a507466a2b7 (diff) | |
download | linux-0ef4c881e4ade7a45174d9cf45eca6f9e10f5ccc.tar.xz |
block: Don't access request after it might be freed
commit 893d290f1d7496db97c9471bc352ad4a11dc8a25 upstream.
After we've done __elv_add_request() and __blk_run_queue() in
blk_execute_rq_nowait(), the request might finish and be freed
immediately. Therefore checking if the type is REQ_TYPE_PM_RESUME
isn't safe afterwards, because if it isn't, rq might be gone.
Instead, check beforehand and stash the result in a temporary.
This fixes crashes in blk_execute_rq_nowait() I get occasionally when
running with lots of memory debugging options enabled -- I think this
race is usually harmless because the window for rq to be reallocated
is so small.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[xr: Backported to 3.4: adjust context]
Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext4/indirect.c')
0 files changed, 0 insertions, 0 deletions