Jeff Layton 8003d3c4aa nfs4: treat lock owners as opaque values
Do the following set of ops with a file on a NFSv4 mount:

    exec 3>>/file/on/nfsv4
    flock -x 3
    exec 3>&-

You'll see the LOCK request go across the wire, but no LOCKU when the
file is closed.

What happens is that the fd is passed across a fork, and the final close
is done in a different process than the opener. That makes
__nfs4_find_lock_state miss finding the correct lock state because it
uses the fl_pid as a search key. A new one is created, and the locking
code treats it as a delegation stateid (because NFS_LOCK_INITIALIZED
isn't set).

The root cause of this breakage seems to be commit 77041ed9b49a9e
(NFSv4: Ensure the lockowners are labelled using the fl_owner and/or
fl_pid).

That changed it so that flock lockowners are allocated based on the
fl_pid. I think this is incorrect. flock locks should be "owned" by the
struct file, and that is already accounted for in the fl_owner field of
the lock request when it comes through nfs_flock.

This patch basically reverts the above commit and with it, a LOCKU is
sent in the above reproducer.

Signed-off-by: Jeff Layton <jlayton@poochiereds.net>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2014-07-12 18:36:31 -04:00
..
2013-06-08 16:20:18 -04:00
2014-07-08 14:30:03 -04:00
2014-07-12 18:22:58 -04:00
2014-07-12 18:22:58 -04:00
2014-04-18 14:20:48 +02:00
2014-06-24 18:47:00 -04:00
2014-06-24 18:47:00 -04:00
2013-11-15 13:41:43 -05:00
2012-10-02 08:17:02 -07:00
2012-07-30 19:06:41 -04:00
2012-07-30 19:06:52 -04:00
2014-06-24 18:47:02 -04:00
2014-06-24 18:47:01 -04:00
2014-06-24 18:47:01 -04:00
2014-06-24 18:47:00 -04:00
2014-06-25 19:01:27 -04:00
2014-06-24 18:47:00 -04:00