lkml.org 
[lkml]   [2008]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] PCI: vpd handle longer delays in access
On Thu, Sep 04, 2008 at 01:56:37PM -0700, Stephen Hemminger wrote:
> - udelay(10);
> + if (signal_pending(current))
> + return -EINTR;

If you're going to use _killable instead of _interruptible, this needs
to be fatal_signal_pending(). Otherwise the one who owns the lock can
be interrupted by _any_ signal while those waiting for the lock can only
be interrupted by fatal signals. Which seems daft to me.

> - spin_lock_irq(&vpd->lock);
> + ret = mutex_lock_killable(&vpd->lock);
> + if (ret)
> + return ret;

What's wrong with the shorter:

if (mutex_lock_killable(&vpd->lock))
return -EINTR;
?

The actual error is irrelevant here since userspace will never consume it.

(I agree with Peter about use of yield())

--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."


\
 
 \ /
  Last update: 2008-09-05 14:43    [W:0.099 / U:23.992 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site