From: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
To: Mike Snitzer <snitzer@redhat.com>, Hannes Reinecke <hare@suse.de>
Cc: linux-scsi@vger.kernel.org,
James Bottomley <jbottomley@parallels.com>,
"Alasdair G. Kergon" <agk@redhat.com>,
dm-devel@redhat.com
Subject: Re: dm-mpath: Clear map_context pointer when requeuing
Date: Thu, 01 Dec 2011 09:12:42 +0900 [thread overview]
Message-ID: <4ED6C67A.3060305@ce.jp.nec.com> (raw)
In-Reply-To: <20111130144951.GA13775@redhat.com>
Hi Hannes,
On 11/30/11 23:49, Mike Snitzer wrote:
> On Wed, Nov 30 2011 at 9:25am -0500,
> Hannes Reinecke <hare@suse.de> wrote:
>
>> When requeing a request we should be clearing the map_context
>> pointer, otherwise we might access an invalid memory location.
Could you elaborate on the mechanism how the map_context->ptr
(= mpio) is accessed after freeing it?
mpio is known to be non-NULL where it is used. So clearing the pointer
should not make any difference in logic.
If this is a preventive change so that we can see NULL dereference
instead of random invalid access if anything happens, it should be
noted in the patch description and in the code.
Otherwise, somebody looking at the code/change in future might be
confused: "why we have to clear this pointer?"
And there are other places where mpio is freed.
(E.g. in dispatch_queued_ios() in dm-mpath.c)
Don't we need the same change there?
>> Cc: Mike Snitzer <snitzer@redhat.com>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>> Tested-by: Heiko Carstens <heiko.carstens@de.ibm.com>
>
> Acked-by: Mike Snitzer <snitzer@redhat.com>
>
> Should Cc: stable too.
>
> (I was thinking Alasdair would pick this up for 3.2 seeing as it is a
> change to dm-mpath.c. Alasdair, James.. I'll let you guys decide)
--
Jun'ichi Nomura, NEC Corporation
next prev parent reply other threads:[~2011-12-01 0:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 14:25 [PATCH] dm-mpath: Clear map_context pointer when requeuing Hannes Reinecke
2011-11-30 14:49 ` Mike Snitzer
2011-12-01 0:12 ` Jun'ichi Nomura [this message]
2011-12-02 16:19 ` Hannes Reinecke
2011-12-05 10:49 ` Jun'ichi Nomura
2011-12-05 16:23 ` Hannes Reinecke
2011-12-06 4:44 ` Jun'ichi Nomura
2012-03-19 15:00 ` [dm-devel] " Alasdair G Kergon
2011-12-05 14:15 ` [dm-devel] [PATCH] " Dave Wysochanski
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=4ED6C67A.3060305@ce.jp.nec.com \
--to=j-nomura@ce.jp.nec.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=hare@suse.de \
--cc=jbottomley@parallels.com \
--cc=linux-scsi@vger.kernel.org \
--cc=snitzer@redhat.com \
/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.