From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Kumar Gala <galak@gate.crashing.org>,
Andrew Morton <akpm@osdl.org>,
wim@iguana.be, linux-kernel@vger.kernel.org,
linuxppc-embedded@ozlabs.org
Subject: Re: [PATCH] powerpc: remove useless spinlock from mpc83xx watchdog
Date: Thu, 19 Jan 2006 14:48:11 -0200 [thread overview]
Message-ID: <20060119164811.GB4418@dmt.cnet> (raw)
In-Reply-To: <1137664156.8471.16.camel@localhost.localdomain>
On Thu, Jan 19, 2006 at 09:49:16AM +0000, Alan Cox wrote:
> On Iau, 2006-01-19 at 00:58 -0600, Kumar Gala wrote:
> > Since we can only open the watchdog once having a spinlock to protect
> > multiple access is pointless.
> >
> > Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>
> NAK
>
> This is a common mistake.
>
> open is called on the open() call and is indeed in this case 'single
> open', but file handles can be inherited and many users may have access
> to a single file handle.
>
> eg
>
> f = open("/dev/watchdog", O_RDWR);
> fork();
> while(1) {
> write(f, "Boing", 5);
> }
Oops.
At least 50% of the watchdog drivers rely solely on the "wdt_is_open"
atomic variable and are broken with respect to synchronization.
next prev parent reply other threads:[~2006-01-19 18:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-19 6:58 Kumar Gala
2006-01-19 9:49 ` Alan Cox
2006-01-19 14:21 ` Kumar Gala
2006-01-19 16:48 ` Marcelo Tosatti [this message]
2006-01-19 22:12 ` Alan Cox
2006-01-20 11:55 ` Wim Van Sebroeck
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=20060119164811.GB4418@dmt.cnet \
--to=marcelo.tosatti@cyclades.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=galak@gate.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-embedded@ozlabs.org \
--cc=wim@iguana.be \
/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®