From: "Ed L. Cashin" <ecashin@coraid.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Matthias Kaehlcke <matthias@kaehlcke.net>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ATA over Ethernet: Convert emsgs_sema in a completion
Date: Wed, 21 May 2008 10:49:24 -0400 [thread overview]
Message-ID: <20080521144924.GD22566@coraid.com> (raw)
In-Reply-To: <20080519165122.9d94cc1c.akpm@linux-foundation.org>
On Mon, May 19, 2008 at 04:51:22PM -0700, Andrew Morton wrote:
> On Fri, 16 May 2008 21:11:33 +0200
> Matthias Kaehlcke <matthias@kaehlcke.net> wrote:
>
> > @@ -216,7 +217,7 @@ aoechr_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off)
> >
> > spin_unlock_irqrestore(&emsgs_lock, flags);
> >
> > - n = down_interruptible(&emsgs_sema);
> > + n = wait_for_completion_interruptible(&emsgs_comp);
>
> Patch looks OK, but I worry about this code. Suppose a signal is sent
> and we return to userspace with the complete() still outstanding. Then
> someone removes the module.
>
> Perhaps there is synchronisation code which prevents that crash?
I plan to answer this question soon. Right now I am quite busy.
This emsgs_sema part of the aoe driver has never caused any problems
for users but has caused many problems for me, because it is tricky to
think about, to talk about, and for others to patch.
I hope that there is a more straightforward way to get the current
read-from-the-file-forever behavior using an existing kernel
facility. A user currently can do,
cat /dev/etherd/err
... and have it block, waiting until there is an error to report,
printing it, and then blocking again, like reading from a pipe.
--
Ed L Cashin <ecashin@coraid.com>
next prev parent reply other threads:[~2008-05-21 15:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-16 19:11 [PATCH] ATA over Ethernet: Convert emsgs_sema in a completion Matthias Kaehlcke
2008-05-19 23:51 ` Andrew Morton
2008-05-21 14:49 ` Ed L. Cashin [this message]
2008-05-21 18:38 ` Andrew Morton
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=20080521144924.GD22566@coraid.com \
--to=ecashin@coraid.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias@kaehlcke.net \
/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.