public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Baruch Siach <baruch@tkos.co.il>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] delay.h: add __must_check to msleep_interruptible
Date: Fri, 17 Dec 2010 15:55:31 -0800	[thread overview]
Message-ID: <20101217155531.89efe13f.akpm@linux-foundation.org> (raw)
In-Reply-To: <20101217154947.3e95488c.akpm@linux-foundation.org>

On Fri, 17 Dec 2010 15:49:47 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Thu,  4 Nov 2010 10:55:41 +0200
> Baruch Siach <baruch@tkos.co.il> wrote:
> 
> > Code calling msleep_interruptible() must be aware that sleep time might be
> > shorter than intended as a result of a signal being caught. Code not checking
> > the return value of msleep_interruptible() is probably buggy, unless it's doing
> > the signal_pending() check itself, which is redundant.
> > 
> 
> True.  But there are around 250 callsites which don't check the
> msleep_interruptible() return value.

One quick way of fixing this would be to add

/*
 * Used by callsites which are supposed to be calling msleep_interruptible(),
 * but which were failing to properly handle msleep_interruptible()'s return
 * value
 */
static inline void msleep_you_suck_fixme_please(unsigned int msecs)
{
	msleep(msecs);
}

and then patch all the offending msleep_interruptible() callsites to
use msleep_you_suck_fixme_please().  Then add the __must_check to
msleep_interruptible().

And note that 250 msleep_interruptible() -> msleep() changes will
probably fix lots of bugs.

      reply	other threads:[~2010-12-17 23:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04  8:55 [PATCH] delay.h: add __must_check to msleep_interruptible Baruch Siach
2010-12-16  6:17 ` Baruch Siach
2010-12-16  8:20   ` Andrew Morton
2010-12-17 23:49 ` Andrew Morton
2010-12-17 23:55   ` 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=20101217155531.89efe13f.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=baruch@tkos.co.il \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox