All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, trond.myklebust@primarydata.com,
	Andy Lutomirski <luto@amacapital.net>
Subject: Re: [PATCH 0/2] locks: allow mandatory locking to work with file-private locks
Date: Mon, 10 Mar 2014 15:21:46 -0400	[thread overview]
Message-ID: <20140310192146.GE28006@fieldses.org> (raw)
In-Reply-To: <1394458607-23579-1-git-send-email-jlayton@redhat.com>

On Mon, Mar 10, 2014 at 09:36:45AM -0400, Jeff Layton wrote:
> This patchset fixes the problems that Trond pointed out last week,
> namely that you can end up deadlocking yourself if you set a
> file-private lock on a file and then do some I/O on the same.
> 
> With this set, mandatory locking should work more or less as you'd
> expect with file-private locks. If you set a lock on an open file
> and then do some I/O on it, it won't block. If you try to lock and
> do I/O on different open files, then the I/O may end up blocked.
> 
> Note that this approach is just as racy as the existing mandatory
> lock implementation, but I don't think it makes anything worse there.

As another alternative, could we declare file-private locks to never be
mandatory?

The mandatory bit has only ever applied to traditional posix locks, so I
don't think there's necessarily a presumption they'd apply to this new
lock type as well.

That doesn't necessarily simplify the locks_mandatory_area case as it
then needs __posix_lock_file to be able to ignore traditional posix
locks.

--b.

  parent reply	other threads:[~2014-03-10 19:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10 13:36 [PATCH 0/2] locks: allow mandatory locking to work with file-private locks Jeff Layton
2014-03-10 13:36 ` [PATCH 1/2] locks: fix locks_mandatory_locked to respect " Jeff Layton
2014-03-10 19:04   ` J. Bruce Fields
2014-03-10 13:36 ` [PATCH 2/2] locks: make locks_mandatory_area check for " Jeff Layton
2014-03-10 17:07   ` Andy Lutomirski
2014-03-10 17:31     ` Jeffrey Layton
2014-03-10 17:37       ` Andy Lutomirski
2014-03-10 17:47         ` Jeffrey Layton
2014-03-10 19:21 ` J. Bruce Fields [this message]
2014-03-10 19:31   ` [PATCH 0/2] locks: allow mandatory locking to work with " Jeffrey Layton
2014-03-10 19:37     ` 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=20140310192146.GE28006@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=trond.myklebust@primarydata.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.