From: "Kristian Høgsberg" <krh@redhat.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firewire: fill_bus_reset_event needs lock protection
Date: Fri, 13 Jun 2008 10:21:38 -0400 [thread overview]
Message-ID: <1213366898.25956.0.camel@gaara.bos.redhat.com> (raw)
In-Reply-To: <tkrat.c85eeaa74264184c@s5r6.in-berlin.de>
On Fri, 2008-06-06 at 22:11 +0200, Stefan Richter wrote:
> Callers of fill_bus_reset_event() have to take card->lock. Otherwise
> access to node data may oops if node removal is in progress.
>
> A lockless alternative would be
>
> - event->local_node_id = card->local_node->node_id;
> + tmp = fw_node_get(card->local_node);
> + event->local_node_id = tmp->node_id;
> + fw_node_put(tmp);
>
> and ditto with the other node pointers which fill_bus_reset_event()
> accesses. But I went the locked route because one of the two callers
> already holds the lock. As a bonus, we don't need the memory barrier
> anymore because device->generation and device->node_id are written in
> a card->lock protected section.
Looks good to me.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
prev parent reply other threads:[~2008-06-13 14:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-06 20:11 Stefan Richter
2008-06-13 14:21 ` Kristian Høgsberg [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=1213366898.25956.0.camel@gaara.bos.redhat.com \
--to=krh@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=stefanr@s5r6.in-berlin.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®