linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: Dr Fields James Bruce <bfields@fieldses.org>
Cc: Layton Jeff <jlayton@redhat.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] locks: try to catch potential deadlock between file-private and classic locks from same process
Date: Tue, 4 Mar 2014 18:50:10 -0500	[thread overview]
Message-ID: <BBC36D8F-DE8F-4266-9F69-D82530946E1D@primarydata.com> (raw)
In-Reply-To: <20140304225617.GK12805@fieldses.org>


On Mar 4, 2014, at 17:56, Dr Fields James Bruce <bfields@fieldses.org> wrote:

> On Tue, Mar 04, 2014 at 05:42:31PM -0500, Trond Myklebust wrote:
>> On Mar 4, 2014, at 16:14, Dr Fields James Bruce <bfields@fieldses.org>
>> wrote:
>>> Good point: if I understand it right, in the mandatory locking case,
>>> before doing a read or write we first check if we'd be able to apply
>>> a classic posix lock.  And that lock will always conflict with a
>>> file-private lock.
>>> 
>>> I think we should just not worry about it and see if anyone
>>> complains.  File-private locks are a new feature and I don't see
>>> that we're under any obligation to support the combination of
>>> file-private locks and mandatory locking.
>>> 
>>> Mandatory locking is already buggy (because of the race between
>>> checking for locks and performing the IO).  If we get no complaints
>>> about this file-private behavior then that's more evidence we could
>>> use to justify just ripping it out completely some day....
> ...
>> The problem is that mandatory locking is something the administrator
>> and user enable. It isn’t entirely under the control of the
>> application… If you write a program that uses file-private locks, I
>> can trivially DOS it by manipulating the mount parameters and
>> manipulating the file's group execute and sgid bit.
> 
> Or you could take a lock on the file and DOS it in the same way.
> 
> Why isn't the answer "don't do that”?

…because as a rule, it is bloody non-obvious and neither you nor Jeff had thought of it?


_________________________________
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust@primarydata.com

--
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

  reply	other threads:[~2014-03-04 23:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 19:10 [PATCH] locks: try to catch potential deadlock between file-private and classic locks from same process Jeff Layton
2014-03-04 19:19 ` Andy Lutomirski
2014-03-04 19:35 ` J. Bruce Fields
2014-03-04 20:14   ` Jeff Layton
2014-03-04 20:19     ` Andy Lutomirski
2014-03-04 20:37       ` Jeff Layton
2014-03-04 20:40         ` J. Bruce Fields
2014-03-04 20:44           ` Jeff Layton
2014-03-04 20:52         ` Trond Myklebust
2014-03-04 21:14           ` Dr Fields James Bruce
2014-03-04 21:24             ` Jeff Layton
2014-03-04 22:42             ` Trond Myklebust
2014-03-04 22:56               ` Dr Fields James Bruce
2014-03-04 23:50                 ` Trond Myklebust [this message]
2014-03-06 18:41                   ` Dr Fields James Bruce
2014-03-06 18:58                     ` Trond Myklebust
2014-03-04 21:21           ` Jeff Layton
2014-03-04 20:35     ` J. Bruce Fields

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=BBC36D8F-DE8F-4266-9F69-D82530946E1D@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=bfields@fieldses.org \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=luto@amacapital.net \
    /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;
as well as URLs for NNTP newsgroup(s).