linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Fw: Spam: [Bugme-new] [Bug 2829] New: posix_locks_deadlock() loops infinitely
@ 2004-06-05  7:25 Stephen Rothwell
  2004-06-06  3:04 ` Stephen Rothwell
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2004-06-05  7:25 UTC (permalink / raw)
  To: sfr, trond.myklebust; +Cc: akpm, linux-fsdevel, willy

From: Trond Myklebust <trond.myklebust@fys.uio.no>
> På fr , 04/06/2004 klokka 23:29, skreiv Stephen Rothwell:
> > 
> > I used to think so, but Andrew Tridgell convinced me that since it
> > actually returns false positives and false negatives in the presence of
> > threads, all we are really doing is trying to paper over user mode
> > programming errors ...
> 
> So you are saying that extending a lock is basically a programming
> error?

No, I am saying that (given POSIX semnatics) if you have a set of
cooperating processes or threads that use POSIX advisory file locks for
resource management (or synchronization) (and any set of processing
using file locks had better be cooperating) and you get a deadlock,
then you have a programming or design error.  Especially if you depend
on the OS to detect that deadlock as POSIX says that the OS does not
have to do the detection.

So any correctly written program that suspects (for some unforseen
reason) that its use of POSIX file locking may cause deadlock, MUST be
able to cope if the OS dies not detect that deadlock anyway.  If it
deosn't, then there are some OS platforms that are POSIX compliant on
which that program will deadlock and it is not the OS platform's
fault/problem.

I am saying that for the sake of less complicated kernel code Linux
should become one such platform.

At the moment we return false positives and false negatives (and
apparently freeze solid under some circumstances), so we would be much
better off not trying to do something that is possibly impossible for
us to do anyway.

Besides which, the POSIX spec does not even talk about the interaction
of POSIX files locks with POSIX thread as far as I can tell, so we are
basically making up the semantics ...

Cheers,
Stephen Rothwell

P.S. If you want the longer version, ask Tridge how sambs copes with
doing locking ...
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: Killing POSIX deadlock detection
@ 2004-06-06 15:24 Lever, Charles
  0 siblings, 0 replies; 7+ messages in thread
From: Lever, Charles @ 2004-06-06 15:24 UTC (permalink / raw)
  To: Matthew Wilcox, Stephen Rothwell
  Cc: trond.myklebust, akpm, linux-fsdevel, linux-kernel

> So, final call.  Any objections to never returning -EDEADLCK?

not an objection, but a consideration.

is this a change that belongs in 2.6?  it does significantly change the
behavior of the system call API, and could "break" applications.

unless this fixes a significant bug, perhaps it should wait for 2.7?
that would give fair warning to developers who need to fix their broken
programs.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-06-06 20:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-05  7:25 Fw: Spam: [Bugme-new] [Bug 2829] New: posix_locks_deadlock() loops infinitely Stephen Rothwell
2004-06-06  3:04 ` Stephen Rothwell
2004-06-06 13:27   ` Killing POSIX deadlock detection Matthew Wilcox
2004-06-06 19:49     ` Trond Myklebust
2004-06-06 20:09       ` Eric W. Biederman
2004-06-06 20:52         ` Trond Myklebust
  -- strict thread matches above, loose matches on Subject: below --
2004-06-06 15:24 Lever, Charles

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).