From: Jens Axboe <axboe@kernel.dk>
To: Roland Dreier <roland@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: Don't access request after it might be freed
Date: Thu, 22 Nov 2012 11:30:26 +0100 [thread overview]
Message-ID: <50ADFEC2.8040100@kernel.dk> (raw)
In-Reply-To: <1353578411-23527-1-git-send-email-roland@kernel.org>
On 2012-11-22 11:00, Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
>
> 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.
Thanks Roland, that's obviously a bug, not safe to touch the request
even after insertion, let alone running the queue. Applied.
--
Jens Axboe
prev parent reply other threads:[~2012-11-22 20:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-22 10:00 [PATCH] block: Don't access request after it might be freed Roland Dreier
2012-11-22 10:30 ` Jens Axboe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50ADFEC2.8040100@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.