public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: Matthew Wilcox <willy@debian.org>
Cc: Linus Torvalds <torvald@transmeta.com>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	Saurabh Desai <sdesai@austin.ibm.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/locks.c: Fix posix locking for threaded tasks
Date: Mon, 10 Jun 2002 00:41:20 -0600	[thread overview]
Message-ID: <20020610064120.GH20388@turbolinux.com> (raw)
In-Reply-To: <20020610034843.W27186@parcelfarce.linux.theplanet.co.uk>

On Jun 10, 2002  03:48 +0100, Matthew Wilcox wrote:
> Saurabh Desai believes that locks created by threads should not conflict
> with each other.  I'm inclined to agree; I don't know why the test for
> ->fl_pid was added, but the comment suggests that whoever added it wasn't
> sure either.
> 
> Frankly, I have no clue about the intended semantics for threads, and
> SUS v3 does not offer any enlightenment.  But it seems reasonable that
> processes which share a files_struct should share locks.  After all,
> if one process closes the fd, they'll remove locks belonging to the
> other process.

I would pass this by the Samba folks first.  I seem to recall them
complaining about this area.  The "one thread closing a file removes
locks from another thread" is one area that I'm sure they don't like.
Making it so that multiple threads ignore file locks is probably
not going to make them happy either.  I believe one of the issues is
that Samba is running server threads for many remote processes, and
it needs to be able to enforce these locks.

Otherwise, this change makes it impossible to write a multi-threaded
program that _does_ allow you use locking between threads.  If anything,
this PID check could be conditional on some extra lock flag (e.g.
THREADS_SHARE_LOCKS or whatever).

Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/


  reply	other threads:[~2002-06-10  6:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-10  2:48 [PATCH] fs/locks.c: Fix posix locking for threaded tasks Matthew Wilcox
2002-06-10  6:41 ` Andreas Dilger [this message]
2002-06-10 12:41   ` Matthew Wilcox
2002-06-10 20:30     ` Matthew Wilcox
2002-06-12  9:40 ` Alan Cox
2002-06-12 11:45   ` Matthew Wilcox
2002-06-12 22:18     ` Saurabh Desai
2002-06-12 22:33       ` Matthew Wilcox

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=20020610064120.GH20388@turbolinux.com \
    --to=adilger@clusterfs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=sdesai@austin.ibm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=torvald@transmeta.com \
    --cc=willy@debian.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