12 Oct, 2016

1 commit

  • Kernel source files need not include explicitly
    because the top Makefile forces to include it with:

    -include $(srctree)/include/linux/kconfig.h

    This commit removes explicit includes except the following:

    * arch/s390/include/asm/facilities_src.h
    * tools/testing/radix-tree/linux/kernel.h

    These two are used for host programs.

    Link: http://lkml.kernel.org/r/1473656164-11929-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

29 Jul, 2016

1 commit

  • Pull vfs updates from Al Viro:
    "Assorted cleanups and fixes.

    Probably the most interesting part long-term is ->d_init() - that will
    have a bunch of followups in (at least) ceph and lustre, but we'll
    need to sort the barrier-related rules before it can get used for
    really non-trivial stuff.

    Another fun thing is the merge of ->d_iput() callers (dentry_iput()
    and dentry_unlink_inode()) and a bunch of ->d_compare() ones (all
    except the one in __d_lookup_lru())"

    * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
    fs/dcache.c: avoid soft-lockup in dput()
    vfs: new d_init method
    vfs: Update lookup_dcache() comment
    bdev: get rid of ->bd_inodes
    Remove last traces of ->sync_page
    new helper: d_same_name()
    dentry_cmp(): use lockless_dereference() instead of smp_read_barrier_depends()
    vfs: clean up documentation
    vfs: document ->d_real()
    vfs: merge .d_select_inode() into .d_real()
    unify dentry_iput() and dentry_unlink_inode()
    binfmt_misc: ->s_root is not going anywhere
    drop redundant ->owner initializations
    ufs: get rid of redundant checks
    orangefs: constify inode_operations
    missed comment updates from ->direct_IO() prototype change
    file_inode(f)->i_mapping is f->f_mapping
    trim fsnotify hooks a bit
    9p: new helper - v9fs_parent_fid()
    debugfs: ->d_parent is never NULL or negative
    ...

    Linus Torvalds
     

01 Jul, 2016

1 commit

  • If the lockd service fails to start up then we need to be sure that the
    notifier blocks are not registered, otherwise a subsequent start of the
    service could cause the same notifier to be registered twice, leading to
    soft lockups.

    Signed-off-by: Scott Mayhew
    Cc: stable@vger.kernel.org
    Fixes: 0751ddf77b6a "lockd: Register callbacks on the inetaddr_chain..."
    Signed-off-by: J. Bruce Fields

    Scott Mayhew
     

30 May, 2016

1 commit


07 Jan, 2016

2 commits


23 Dec, 2015

1 commit


12 Nov, 2015

1 commit

  • Pull nfsd updates from Bruce Fields:
    "Apologies for coming a little late in the merge window. Fortunately
    this is another fairly quiet one:

    Mainly smaller bugfixes and cleanup. We're still finding some bugs
    from the breakup of the big NFSv4 state lock in 3.17 -- thanks
    especially to Andrew Elble and Jeff Layton for tracking down some of
    the remaining races"

    * tag 'nfsd-4.4' of git://linux-nfs.org/~bfields/linux:
    svcrpc: document lack of some memory barriers
    nfsd: fix race with open / open upgrade stateids
    nfsd: eliminate sending duplicate and repeated delegations
    nfsd: remove recurring workqueue job to clean DRC
    SUNRPC: drop stale comment in svc_setup_socket()
    nfsd: ensure that seqid morphing operations are atomic wrt to copies
    nfsd: serialize layout stateid morphing operations
    nfsd: improve client_has_state to check for unused openowners
    nfsd: fix clid_inuse on mount with security change
    sunrpc/cache: make cache flushing more reliable.
    nfsd: move include of state.h from trace.c to trace.h
    sunrpc: avoid warning in gss_key_timeout
    lockd: get rid of reference-counted NSM RPC clients
    SUNRPC: Use MSG_SENDPAGE_NOTLAST when calling sendpage()
    lockd: create NSM handles per net namespace
    nfsd: switch unsigned char flags in svc_fh to bools
    nfsd: move svc_fh->fh_maxsize to just after fh_handle
    nfsd: drop null test before destroy functions
    nfsd: serialize state seqid morphing operations

    Linus Torvalds
     

24 Oct, 2015

1 commit

  • Currently we have reference-counted per-net NSM RPC client
    which created on the first monitor request and destroyed
    after the last unmonitor request. It's needed because
    RPC client need to know 'utsname()->nodename', but utsname()
    might be NULL when nsm_unmonitor() called.

    So instead of holding the rpc client we could just save nodename
    in struct nlm_host and pass it to the rpc_create().
    Thus ther is no need in keeping rpc client until last
    unmonitor request. We could create separate RPC clients
    for each monitor/unmonitor requests.

    Signed-off-by: Andrey Ryabinin
    Signed-off-by: J. Bruce Fields

    Andrey Ryabinin
     

23 Oct, 2015

1 commit


13 Oct, 2015

1 commit

  • Commit cb7323fffa85 ("lockd: create and use per-net NSM
    RPC clients on MON/UNMON requests") introduced per-net
    NSM RPC clients. Unfortunately this doesn't make any sense
    without per-net nsm_handle.

    E.g. the following scenario could happen
    Two hosts (X and Y) in different namespaces (A and B) share
    the same nsm struct.

    1. nsm_monitor(host_X) called => NSM rpc client created,
    nsm->sm_monitored bit set.
    2. nsm_mointor(host-Y) called => nsm->sm_monitored already set,
    we just exit. Thus in namespace B ln->nsm_clnt == NULL.
    3. host X destroyed => nsm->sm_count decremented to 1
    4. host Y destroyed => nsm_unmonitor() => nsm_mon_unmon() => NULL-ptr
    dereference of *ln->nsm_clnt

    So this could be fixed by making per-net nsm_handles list,
    instead of global. Thus different net namespaces will not be able
    share the same nsm_handle.

    Signed-off-by: Andrey Ryabinin
    Cc:
    Signed-off-by: J. Bruce Fields

    Andrey Ryabinin
     

13 Aug, 2015

1 commit


11 Aug, 2015

2 commits


22 Apr, 2015

1 commit

  • Commit f895b252d4edf ("sunrpc: eliminate RPC_DEBUG") introduced
    use of IS_ENABLED() in a uapi header which leads to a build
    failure for userspace apps trying to use :

    linux/nfsd/debug.h:18:15: error: missing binary operator before token "("
    #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
    ^

    Since this was only used to define NFSD_DEBUG if CONFIG_SUNRPC_DEBUG
    is enabled, replace instances of NFSD_DEBUG with CONFIG_SUNRPC_DEBUG.

    Cc: stable@vger.kernel.org
    Fixes: f895b252d4edf "sunrpc: eliminate RPC_DEBUG"
    Signed-off-by: Mark Salter
    Reviewed-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Mark Salter
     

13 Feb, 2015

1 commit

  • Pull nfsd updates from Bruce Fields:
    "The main change is the pNFS block server support from Christoph, which
    allows an NFS client connected to shared disk to do block IO to the
    shared disk in place of NFS reads and writes. This also requires xfs
    patches, which should arrive soon through the xfs tree, barring
    unexpected problems. Support for other filesystems is also possible
    if there's interest.

    Thanks also to Chuck Lever for continuing work to get NFS/RDMA into
    shape"

    * 'for-3.20' of git://linux-nfs.org/~bfields/linux: (32 commits)
    nfsd: default NFSv4.2 to on
    nfsd: pNFS block layout driver
    exportfs: add methods for block layout exports
    nfsd: add trace events
    nfsd: update documentation for pNFS support
    nfsd: implement pNFS layout recalls
    nfsd: implement pNFS operations
    nfsd: make find_any_file available outside nfs4state.c
    nfsd: make find/get/put file available outside nfs4state.c
    nfsd: make lookup/alloc/unhash_stid available outside nfs4state.c
    nfsd: add fh_fsid_match helper
    nfsd: move nfsd_fh_match to nfsfh.h
    fs: add FL_LAYOUT lease type
    fs: track fl_owner for leases
    nfs: add LAYOUT_TYPE_MAX enum value
    nfsd: factor out a helper to decode nfstime4 values
    sunrpc/lockd: fix references to the BKL
    nfsd: fix year-2038 nfs4 state problem
    svcrdma: Handle additional inline content
    svcrdma: Move read list XDR round-up logic
    ...

    Linus Torvalds
     

12 Feb, 2015

1 commit

  • Pull NFS client updates from Trond Myklebust:
    "Highlights incluse:

    Features:
    - Removing the forced serialisation of open()/close() calls in
    NFSv4.x (x>0) makes for a significant performance improvement in
    metadata intensive workloads.
    - Full support for the pNFS "flexible files" layout type
    - Further RPC/RDMA client improvements from Chuck

    Bugfixes:
    - Stable fix: NFSv4.1 backchannel calls blocking operations with !TASK_RUNNING
    - Stable fix: pnfs_generic_pg_init_read/write can be called with lseg == NULL
    - Stable fix: Fix an Oopsable condition when nsm_mon_unmon is called
    as part of the namespace cleanup,
    - Stable fix: Ensure we reference the inode for return-on-close in
    delegreturn
    - Use SO_REUSEPORT to ensure that NFSv3 TCP connections can rebind to
    the same source address/port combination during a disconnect/
    reconnect event. This is a requirement imposed by most NFSv3
    server duplicate reply cache implementations.

    Optimisations:
    - Ask for no NFSv4.1 delegations on OPEN if using O_DIRECT

    Other:
    - Add Anna Schumaker as co-maintainer for the NFS client"

    * tag 'nfs-for-3.20-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (119 commits)
    SUNRPC: Cleanup to remove xs_tcp_close()
    pnfs: delete an unintended goto
    pnfs/flexfiles: Do not dprintk after the free
    SUNRPC: Fix stupid typo in xs_sock_set_reuseport
    SUNRPC: Define xs_tcp_fin_timeout only if CONFIG_SUNRPC_DEBUG
    SUNRPC: Handle connection reset more efficiently.
    SUNRPC: Remove the redundant XPRT_CONNECTION_CLOSE flag
    SUNRPC: Make xs_tcp_close() do a socket shutdown rather than a sock_release
    SUNRPC: Ensure xs_tcp_shutdown() requests a full close of the connection
    SUNRPC: Cleanup to remove remaining uses of XPRT_CONNECTION_ABORT
    SUNRPC: Remove TCP socket linger code
    SUNRPC: Remove TCP client connection reset hack
    SUNRPC: TCP/UDP always close the old socket before reconnecting
    SUNRPC: Add helpers to prevent socket create from racing
    SUNRPC: Ensure xs_reset_transport() resets the close connection flags
    SUNRPC: Do not clear the source port in xs_reset_transport
    SUNRPC: Handle EADDRINUSE on connect
    SUNRPC: Set SO_REUSEPORT socket option for TCP connections
    NFSv4.1: Fix pnfs_put_lseg races
    NFSv4.1: pnfs_send_layoutreturn should use GFP_NOFS
    ...

    Linus Torvalds
     

11 Feb, 2015

1 commit

  • Pull file locking related changes #1 from Jeff Layton:
    "This patchset contains a fairly major overhaul of how file locks are
    tracked within the inode. Rather than a single list, we now create a
    per-inode "lock context" that contains individual lists for the file
    locks, and a new dedicated spinlock for them.

    There are changes in other trees that are based on top of this set so
    it may be easiest to pull this in early"

    * tag 'locks-v3.20-1' of git://git.samba.org/jlayton/linux:
    locks: update comments that refer to inode->i_flock
    locks: consolidate NULL i_flctx checks in locks_remove_file
    locks: keep a count of locks on the flctx lists
    locks: clean up the lm_change prototype
    locks: add a dedicated spinlock to protect i_flctx lists
    locks: remove i_flock field from struct inode
    locks: convert lease handling to file_lock_context
    locks: convert posix locks to file_lock_context
    locks: move flock locks to file_lock_context
    ceph: move spinlocking into ceph_encode_locks_to_buffer and ceph_count_locks
    locks: add a new struct file_locking_context pointer to struct inode
    locks: have locks_release_file use flock_lock_file to release generic flock locks
    locks: add new struct list_head to struct file_lock

    Linus Torvalds
     

04 Feb, 2015

1 commit


03 Feb, 2015

1 commit


23 Jan, 2015

1 commit


17 Jan, 2015

2 commits


16 Jan, 2015

1 commit


06 Jan, 2015

1 commit

  • This commit fixes a race whereby nlmclnt_init() first starts the lockd
    daemon, and then calls nlm_bind_host() with the expectation that
    nlmsvc_timeout has already been initialised. Unfortunately, there is no
    no synchronisation between lockd() and lockd_up() to guarantee that this
    is the case.

    Fix is to move the initialisation of nlmsvc_timeout into lockd_create_svc

    Fixes: 9a1b6bf818e74 ("LOCKD: Don't call utsname()->nodename...")
    Cc: Bruce Fields
    Cc: stable@vger.kernel.org # 3.10.x
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

17 Dec, 2014

1 commit

  • Pull nfsd updates from Bruce Fields:
    "A comparatively quieter cycle for nfsd this time, but still with two
    larger changes:

    - RPC server scalability improvements from Jeff Layton (using RCU
    instead of a spinlock to find idle threads).

    - server-side NFSv4.2 ALLOCATE/DEALLOCATE support from Anna
    Schumaker, enabling fallocate on new clients"

    * 'for-3.19' of git://linux-nfs.org/~bfields/linux: (32 commits)
    nfsd4: fix xdr4 count of server in fs_location4
    nfsd4: fix xdr4 inclusion of escaped char
    sunrpc/cache: convert to use string_escape_str()
    sunrpc: only call test_bit once in svc_xprt_received
    fs: nfsd: Fix signedness bug in compare_blob
    sunrpc: add some tracepoints around enqueue and dequeue of svc_xprt
    sunrpc: convert to lockless lookup of queued server threads
    sunrpc: fix potential races in pool_stats collection
    sunrpc: add a rcu_head to svc_rqst and use kfree_rcu to free it
    sunrpc: require svc_create callers to pass in meaningful shutdown routine
    sunrpc: have svc_wake_up only deal with pool 0
    sunrpc: convert sp_task_pending flag to use atomic bitops
    sunrpc: move rq_cachetype field to better optimize space
    sunrpc: move rq_splice_ok flag into rq_flags
    sunrpc: move rq_dropme flag into rq_flags
    sunrpc: move rq_usedeferral flag to rq_flags
    sunrpc: move rq_local field to rq_flags
    sunrpc: add a generic rq_flags field to svc_rqst and move rq_secure to it
    nfsd: minor off by one checks in __write_versions()
    sunrpc: release svc_pool_map reference when serv allocation fails
    ...

    Linus Torvalds
     

11 Dec, 2014

1 commit

  • Pull VFS changes from Al Viro:
    "First pile out of several (there _definitely_ will be more). Stuff in
    this one:

    - unification of d_splice_alias()/d_materialize_unique()

    - iov_iter rewrite

    - killing a bunch of ->f_path.dentry users (and f_dentry macro).

    Getting that completed will make life much simpler for
    unionmount/overlayfs, since then we'll be able to limit the places
    sensitive to file _dentry_ to reasonably few. Which allows to have
    file_inode(file) pointing to inode in a covered layer, with dentry
    pointing to (negative) dentry in union one.

    Still not complete, but much closer now.

    - crapectomy in lustre (dead code removal, mostly)

    - "let's make seq_printf return nothing" preparations

    - assorted cleanups and fixes

    There _definitely_ will be more piles"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits)
    copy_from_iter_nocache()
    new helper: iov_iter_kvec()
    csum_and_copy_..._iter()
    iov_iter.c: handle ITER_KVEC directly
    iov_iter.c: convert copy_to_iter() to iterate_and_advance
    iov_iter.c: convert copy_from_iter() to iterate_and_advance
    iov_iter.c: get rid of bvec_copy_page_{to,from}_iter()
    iov_iter.c: convert iov_iter_zero() to iterate_and_advance
    iov_iter.c: convert iov_iter_get_pages_alloc() to iterate_all_kinds
    iov_iter.c: convert iov_iter_get_pages() to iterate_all_kinds
    iov_iter.c: convert iov_iter_npages() to iterate_all_kinds
    iov_iter.c: iterate_and_advance
    iov_iter.c: macros for iterating over iov_iter
    kill f_dentry macro
    dcache: fix kmemcheck warning in switch_names
    new helper: audit_file()
    nfsd_vfs_write(): use file_inode()
    ncpfs: use file_inode()
    kill f_dentry uses
    lockd: get rid of ->f_path.dentry->d_sb
    ...

    Linus Torvalds
     

10 Dec, 2014

2 commits


25 Nov, 2014

1 commit


20 Nov, 2014

1 commit


07 Nov, 2014

1 commit

  • When lockd can't talk to a remote statd, it'll spew a warning message
    to the ring buffer. If the application is really hammering on locks
    however, it's possible for that message to spam the logs. Ratelimit it
    to minimize the potential for harm.

    Reported-by: Ian Collier
    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     

12 Oct, 2014

1 commit

  • Pull file locking related changes from Jeff Layton:
    "This release is a little more busy for file locking changes than the
    last:

    - a set of patches from Kinglong Mee to fix the lockowner handling in
    knfsd
    - a pile of cleanups to the internal file lease API. This should get
    us a bit closer to allowing for setlease methods that can block.

    There are some dependencies between mine and Bruce's trees this cycle,
    and I based my tree on top of the requisite patches in Bruce's tree"

    * tag 'locks-v3.18-1' of git://git.samba.org/jlayton/linux: (26 commits)
    locks: fix fcntl_setlease/getlease return when !CONFIG_FILE_LOCKING
    locks: flock_make_lock should return a struct file_lock (or PTR_ERR)
    locks: set fl_owner for leases to filp instead of current->files
    locks: give lm_break a return value
    locks: __break_lease cleanup in preparation of allowing direct removal of leases
    locks: remove i_have_this_lease check from __break_lease
    locks: move freeing of leases outside of i_lock
    locks: move i_lock acquisition into generic_*_lease handlers
    locks: define a lm_setup handler for leases
    locks: plumb a "priv" pointer into the setlease routines
    nfsd: don't keep a pointer to the lease in nfs4_file
    locks: clean up vfs_setlease kerneldoc comments
    locks: generic_delete_lease doesn't need a file_lock at all
    nfsd: fix potential lease memory leak in nfs4_setlease
    locks: close potential race in lease_get_mtime
    security: make security_file_set_fowner, f_setown and __f_setown void return
    locks: consolidate "nolease" routines
    locks: remove lock_may_read and lock_may_write
    lockd: rip out deferred lock handling from testlock codepath
    NFSD: Get reference of lockowner when coping file_lock
    ...

    Linus Torvalds
     

09 Oct, 2014

2 commits

  • Pull nfsd updates from Bruce Fields:
    "Highlights:

    - support the NFSv4.2 SEEK operation (allowing clients to support
    SEEK_HOLE/SEEK_DATA), thanks to Anna.
    - end the grace period early in a number of cases, mitigating a
    long-standing annoyance, thanks to Jeff
    - improve SMP scalability, thanks to Trond"

    * 'for-3.18' of git://linux-nfs.org/~bfields/linux: (55 commits)
    nfsd: eliminate "to_delegation" define
    NFSD: Implement SEEK
    NFSD: Add generic v4.2 infrastructure
    svcrdma: advertise the correct max payload
    nfsd: introduce nfsd4_callback_ops
    nfsd: split nfsd4_callback initialization and use
    nfsd: introduce a generic nfsd4_cb
    nfsd: remove nfsd4_callback.cb_op
    nfsd: do not clear rpc_resp in nfsd4_cb_done_sequence
    nfsd: fix nfsd4_cb_recall_done error handling
    nfsd4: clarify how grace period ends
    nfsd4: stop grace_time update at end of grace period
    nfsd: skip subsequent UMH "create" operations after the first one for v4.0 clients
    nfsd: set and test NFSD4_CLIENT_STABLE bit to reduce nfsdcltrack upcalls
    nfsd: serialize nfsdcltrack upcalls for a particular client
    nfsd: pass extra info in env vars to upcalls to allow for early grace period end
    nfsd: add a v4_end_grace file to /proc/fs/nfsd
    lockd: add a /proc/fs/lockd/nlm_end_grace file
    nfsd: reject reclaim request when client has already sent RECLAIM_COMPLETE
    nfsd: remove redundant boot_time parm from grace_done client tracking op
    ...

    Linus Torvalds
     
  • Pull NFS client updates from Trond Myklebust:
    "Highlights include:

    Stable fixes:
    - fix an NFSv4.1 state renewal regression
    - fix open/lock state recovery error handling
    - fix lock recovery when CREATE_SESSION/SETCLIENTID_CONFIRM fails
    - fix statd when reconnection fails
    - don't wake tasks during connection abort
    - don't start reboot recovery if lease check fails
    - fix duplicate proc entries

    Features:
    - pNFS block driver fixes and clean ups from Christoph
    - More code cleanups from Anna
    - Improve mmap() writeback performance
    - Replace use of PF_TRANS with a more generic mechanism for avoiding
    deadlocks in nfs_release_page"

    * tag 'nfs-for-3.18-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (66 commits)
    NFSv4.1: Fix an NFSv4.1 state renewal regression
    NFSv4: fix open/lock state recovery error handling
    NFSv4: Fix lock recovery when CREATE_SESSION/SETCLIENTID_CONFIRM fails
    NFS: Fabricate fscache server index key correctly
    SUNRPC: Add missing support for RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT
    NFSv3: Fix missing includes of nfs3_fs.h
    NFS/SUNRPC: Remove other deadlock-avoidance mechanisms in nfs_release_page()
    NFS: avoid waiting at all in nfs_release_page when congested.
    NFS: avoid deadlocks with loop-back mounted NFS filesystems.
    MM: export page_wakeup functions
    SCHED: add some "wait..on_bit...timeout()" interfaces.
    NFS: don't use STABLE writes during writeback.
    NFSv4: use exponential retry on NFS4ERR_DELAY for async requests.
    rpc: Add -EPERM processing for xs_udp_send_request()
    rpc: return sent and err from xs_sendpages()
    lockd: Try to reconnect if statd has moved
    SUNRPC: Don't wake tasks during connection abort
    Fixing lease renewal
    nfs: fix duplicate proc entries
    pnfs/blocklayout: Fix a 64-bit division/remainder issue in bl_map_stripe
    ...

    Linus Torvalds
     

25 Sep, 2014

1 commit


18 Sep, 2014

2 commits

  • Add a new procfile that will allow a (privileged) userland process to
    end the NLM grace period early. The basic idea here will be to have
    sm-notify write to this file, if it sent out no NOTIFY requests when
    it runs. In that situation, we can generally expect that there will be
    no reclaim requests so the grace period can be lifted early.

    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Currently, all of the grace period handling is part of lockd. Eventually
    though we'd like to be able to build v4-only servers, at which point
    we'll need to put all of this elsewhere.

    Move the code itself into fs/nfs_common and have it build a grace.ko
    module. Then, rejigger the Kconfig options so that both nfsd and lockd
    enable it automatically.

    Signed-off-by: Jeff Layton

    Jeff Layton
     

10 Sep, 2014

2 commits

  • As Kinglong points out, the nlm_block->b_fl field is no longer used at
    all. Also, vfs_test_lock in the generic locking code will only return
    FILE_LOCK_DEFERRED if FL_SLEEP is set, and it isn't here.

    The only other place that returns that value is the DLM lock code, but
    it only does that in dlm_posix_lock, never in dlm_posix_get.

    Remove all of the deferred locking code from the testlock codepath
    since it doesn't appear to ever be used anyway.

    I do have a small concern that this might cause a behavior change in the
    case where you have a block already sitting on the list when the
    testlock request comes in, but that looks like it doesn't really work
    properly anyway. I think it's best to just pass that down to
    vfs_test_lock and let the filesystem report that instead of trying to
    infer what's going on with the lock by looking at an existing block.

    Cc: cluster-devel@redhat.com
    Signed-off-by: Jeff Layton
    Reviewed-by: Kinglong Mee

    Jeff Layton
     
  • Commit d5b9026a67 ([PATCH] knfsd: locks: flag NFSv4-owned locks) using
    fl_lmops field in file_lock for checking nfsd4 lockowner.

    But, commit 1a747ee0cc (locks: don't call ->copy_lock methods on return
    of conflicting locks) causes the fl_lmops of conflock always be NULL.

    Also, commit 0996905f93 (lockd: posix_test_lock() should not call
    locks_copy_lock()) caused the fl_lmops of conflock always be NULL too.

    Make sure copy the private information by fl_copy_lock() in struct
    file_lock_operations, merge __locks_copy_lock() to fl_copy_lock().

    Jeff advice, "Set fl_lmops on conflocks, but don't set fl_ops.
    fl_ops are superfluous, since they are callbacks into the filesystem.
    There should be no need to bother the filesystem at all with info
    in a conflock. But, lock _ownership_ matters for conflocks and that's
    indicated by the fl_lmops. So you really do want to copy the fl_lmops
    for conflocks I think."

    v5: add missing calling of locks_release_private() in nlmsvc_testlock()
    v4: only copy fl_lmops for conflock, don't copy fl_ops

    Signed-off-by: Kinglong Mee
    Signed-off-by: Jeff Layton

    Kinglong Mee