All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-cifs-client@lists.samba.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] CIFS: make cifsd (more) signal-safe
Date: Wed, 6 Jun 2007 09:55:50 +0100	[thread overview]
Message-ID: <20070606085550.GA7351@infradead.org> (raw)
In-Reply-To: <20070605152340.f09fa6f2.jlayton@redhat.com>

On Tue, Jun 05, 2007 at 03:23:40PM -0400, Jeff Layton wrote:
> I recently sent a similar, smaller patch for this problem. After some
> discussion with Steve and Shaggy, I think I better understand why cifsd
> allows signals through, and I realize that my earlier patch wasn't
> comprehensive enough
> 
> The mount and unmount calls will send a KILL signal to cifsd to wake it
> up if it happens to be blocked in kernel_recvmsg. The problem is that
> it doesn't distinguish between "legitimate" signals sent for this
> reason and spurious signals sent by a userspace process (for instance).
> While this is definitely a "don't do that" sort of situation, we might
> as well try to have cifsd be as signal-safe as possible.
> 
> The following patch does this by making sure that we set tcpStatus to
> CifsExiting before sending cifsd a signal, and having cifsd check for
> that when it sees that it's been signalled. If the tcpStatus is not set
> correctly, it ignores it, flushes signals and moves on.
> 
> I've tested a similar backported version of this on an earlier kernel,
> but have not tested this particular patch as of yet.

The right way to fix this is to stop sending signals at all and have
a kernel-internal way to get out of kernel_recvmsg.  Uses of signals by
kernel thread generally are bugs.


  reply	other threads:[~2007-06-06  8:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 19:23 [PATCH] CIFS: make cifsd (more) signal-safe Jeff Layton
2007-06-06  8:55 ` Christoph Hellwig [this message]
2007-06-08 16:35   ` [PATCH] RFC: have tcp_recvmsg() check kthread_should_stop() and treat it as if it were signalled Jeff Layton
2007-06-09  1:30     ` Herbert Xu
2007-06-09 11:08       ` Jeff Layton
2007-06-25 19:41         ` Satyam Sharma
2007-06-25 19:52           ` Jeff Layton
2007-06-25 22:09             ` Satyam Sharma
2007-06-26  0:46               ` Jeff Layton
2007-06-26 11:54           ` Oleg Nesterov
2007-06-26 22:53             ` Satyam Sharma
2007-06-27  1:29               ` Satyam Sharma
2007-06-27 12:24               ` Oleg Nesterov
2007-06-28  0:44                 ` Satyam Sharma
2007-06-28 14:12                   ` Oleg Nesterov
2007-06-28 15:44                     ` Satyam Sharma
2007-06-28 16:19                       ` Satyam Sharma
2007-06-28 16:24                       ` Satyam Sharma
2007-06-28 17:08                       ` Oleg Nesterov
2007-06-28 18:41                         ` Jeff Layton
2007-06-28 19:22                         ` Satyam Sharma
2007-06-08 17:00   ` Jeff Layton
2007-06-21 14:35   ` [linux-cifs-client] Re: [PATCH] CIFS: make cifsd (more) signal-safe Jeff Layton

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=20070606085550.GA7351@infradead.org \
    --to=hch@infradead.org \
    --cc=jlayton@redhat.com \
    --cc=linux-cifs-client@lists.samba.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /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.