lkml.org 
[lkml]   [2010]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] delay.h: add __must_check to msleep_interruptible
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.


\
 
 \ /
  Last update: 2010-12-18 00:59    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site