From: Andrew Morton <akpm@linux-foundation.org>
To: "Ed L. Cashin" <ecashin@coraid.com>
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 11:38:30 -0700 [thread overview]
Message-ID: <20080521113830.8eaa4ce1.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080521144924.GD22566@coraid.com>
On Wed, 21 May 2008 10:49:24 -0400 "Ed L. Cashin" <ecashin@coraid.com> wrote:
> 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.
That's fine - the normal way of handling that is for the user's fd to
hold a reference against the module itself.
prev parent reply other threads:[~2008-05-21 18:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-16 19:11 Matthias Kaehlcke
2008-05-19 23:51 ` Andrew Morton
2008-05-21 14:49 ` Ed L. Cashin
2008-05-21 18:38 ` Andrew Morton [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=20080521113830.8eaa4ce1.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=ecashin@coraid.com \
--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 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®