24 Nov, 2015

1 commit

  • If clp->cl_cb_ident is zero, then nfs_cb_idr_remove_locked() skips removing
    it when the nfs_client is freed. A decoding or server bug can then find
    and try to put that first nfs_client which would lead to a crash.

    Signed-off-by: Benjamin Coddington
    Fixes: d6870312659d ("nfs4client: convert to idr_alloc()")
    Cc: stable@vger.kernel.org
    Signed-off-by: Trond Myklebust

    Benjamin Coddington
     

18 Aug, 2015

1 commit


01 Jul, 2015

1 commit


27 Apr, 2015

1 commit

  • Pull NFS client updates from Trond Myklebust:
    "Another set of mainly bugfixes and a couple of cleanups. No new
    functionality in this round.

    Highlights include:

    Stable patches:
    - Fix a regression in /proc/self/mountstats
    - Fix the pNFS flexfiles O_DIRECT support
    - Fix high load average due to callback thread sleeping

    Bugfixes:
    - Various patches to fix the pNFS layoutcommit support
    - Do not cache pNFS deviceids unless server notifications are enabled
    - Fix a SUNRPC transport reconnection regression
    - make debugfs file creation failure non-fatal in SUNRPC
    - Another fix for circular directory warnings on NFSv4 "junctioned"
    mountpoints
    - Fix locking around NFSv4.2 fallocate() support
    - Truncating NFSv4 file opens should also sync O_DIRECT writes
    - Prevent infinite loop in rpcrdma_ep_create()

    Features:
    - Various improvements to the RDMA transport code's handling of
    memory registration
    - Various code cleanups"

    * tag 'nfs-for-4.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (55 commits)
    fs/nfs: fix new compiler warning about boolean in switch
    nfs: Remove unneeded casts in nfs
    NFS: Don't attempt to decode missing directory entries
    Revert "nfs: replace nfs_add_stats with nfs_inc_stats when add one"
    NFS: Rename idmap.c to nfs4idmap.c
    NFS: Move nfs_idmap.h into fs/nfs/
    NFS: Remove CONFIG_NFS_V4 checks from nfs_idmap.h
    NFS: Add a stub for GETDEVICELIST
    nfs: remove WARN_ON_ONCE from nfs_direct_good_bytes
    nfs: fix DIO good bytes calculation
    nfs: Fetch MOUNTED_ON_FILEID when updating an inode
    sunrpc: make debugfs file creation failure non-fatal
    nfs: fix high load average due to callback thread sleeping
    NFS: Reduce time spent holding the i_mutex during fallocate()
    NFS: Don't zap caches on fallocate()
    xprtrdma: Make rpcrdma_{un}map_one() into inline functions
    xprtrdma: Handle non-SEND completions via a callout
    xprtrdma: Add "open" memreg op
    xprtrdma: Add "destroy MRs" memreg op
    xprtrdma: Add "reset MRs" memreg op
    ...

    Linus Torvalds
     

24 Apr, 2015

1 commit

  • This file is only used internally to the NFS v4 module, so it doesn't
    need to be in the global include path. I also renamed it from
    nfs_idmap.h to nfs4idmap.h to emphasize that it's an NFSv4-only include
    file.

    Signed-off-by: Anna Schumaker
    Signed-off-by: Trond Myklebust

    Anna Schumaker
     

16 Apr, 2015

1 commit


04 Mar, 2015

1 commit


04 Feb, 2015

3 commits

  • * flexfiles: (53 commits)
    pnfs: lookup new lseg at lseg boundary
    nfs41: .init_read and .init_write can be called with valid pg_lseg
    pnfs: Update documentation on the Layout Drivers
    pnfs/flexfiles: Add the FlexFile Layout Driver
    nfs: count DIO good bytes correctly with mirroring
    nfs41: wait for LAYOUTRETURN before retrying LAYOUTGET
    nfs: add a helper to set NFS_ODIRECT_RESCHED_WRITES to direct writes
    nfs41: add NFS_LAYOUT_RETRY_LAYOUTGET to layout header flags
    nfs/flexfiles: send layoutreturn before freeing lseg
    nfs41: introduce NFS_LAYOUT_RETURN_BEFORE_CLOSE
    nfs41: allow async version layoutreturn
    nfs41: add range to layoutreturn args
    pnfs: allow LD to ask to resend read through pnfs
    nfs: add nfs_pgio_current_mirror helper
    nfs: only reset desc->pg_mirror_idx when mirroring is supported
    nfs41: add a debug warning if we destroy an unempty layout
    pnfs: fail comparison when bucket verifier not set
    nfs: mirroring support for direct io
    nfs: add mirroring support to pgio layer
    pnfs: pass ds_commit_idx through the commit path
    ...

    Conflicts:
    fs/nfs/pnfs.c
    fs/nfs/pnfs.h

    Trond Myklebust
     
  • flexfile layout may need to set such when making DS connections.

    Signed-off-by: Peng Tao
    Signed-off-by: Tom Haynes

    Peng Tao
     
  • flexfile layout may use different auth flavor as specified by MDS.

    Reviewed-by: Jeff Layton
    Signed-off-by: Peng Tao
    Signed-off-by: Tom Haynes

    Peng Tao
     

22 Jan, 2015

1 commit

  • If we start state recovery on a client that failed to initialise correctly,
    then we are very likely to Oops.

    Reported-by: "Mkrtchyan, Tigran"
    Link: http://lkml.kernel.org/r/130621862.279655.1421851650684.JavaMail.zimbra@desy.de
    Cc: stable@vger.kernel.org
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

06 Jan, 2015

4 commits

  • Detect server trunking across transport protocols. Otherwise, an
    RDMA mount and a TCP mount of the same server will end up with
    separate nfs_clients using the same clientid4.

    Reported-by: Dai Ngo
    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • While we normally expect the NFSv4 client to always send the same client
    owner to all servers, there are a couple of situations where that is not
    the case:
    1) In NFSv4.0, switching between use of '-omigration' and not will cause
    the kernel to switch between using the non-uniform and uniform client
    strings.
    2) In NFSv4.1, or NFSv4.0 when using uniform client strings, if the
    uniquifier string is suddenly changed.

    This patch will catch those situations by checking the client owner id
    in the trunking detection code, and will do the right thing if it notices
    that the strings differ.

    Cc: Chuck Lever
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Ensure that we cache the NFSv4/v4.1 client owner_id so that we can
    verify it when we're doing trunking detection.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Currently, our trunking code will check for session trunking, but will
    fail to detect client id trunking. This is a problem, because it means
    that the client will fail to recognise that the two connections represent
    shared state, even if they do not permit a shared session.
    By removing the check for the server minor id, and only checking the
    major id, we will end up doing the right thing in both cases: we close
    down the new nfs_client and fall back to using the existing one.

    Fixes: 05f4c350ee02e ("NFS: Discover NFSv4 server trunking when mounting")
    Cc: Chuck Lever
    Cc: stable@vger.kernel.org # 3.7.x
    Tested-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

27 Nov, 2014

1 commit


26 Nov, 2014

1 commit


25 Nov, 2014

1 commit


19 Sep, 2014

1 commit

  • There is a race between nfs4_state_manager() and
    nfs_server_remove_lists() that happens during a nfsv3 mount.

    The v3 mount notices there is already a supper block so
    nfs_server_remove_lists() called which uses the nfs_client_lock
    spin lock to synchronize access to the client list.

    At the same time nfs4_state_manager() is running through
    the client list looking for work to do, using the same
    lock. When nfs4_state_manager() wins the race to the
    list, a v3 client pointer is found and not ignored
    properly which causes the panic.

    Moving some protocol checks before the state checking
    avoids the panic.

    CC: Stable Tree
    Signed-off-by: Steve Dickson
    Signed-off-by: Trond Myklebust

    Steve Dickson
     

09 Jul, 2014

1 commit


19 Mar, 2014

1 commit


18 Feb, 2014

1 commit


02 Feb, 2014

1 commit


28 Jan, 2014

1 commit

  • The original printk() made sense when the GSSAPI codepaths were called
    only when sec=krb5* was explicitly requested. Now however, in many cases
    the nfs client will try to acquire GSSAPI credentials by default, even
    when it's not requested.

    Since we don't have a great mechanism to distinguish between the two
    cases, just turn the pr_warn into a dprintk instead. With this change we
    can also get rid of the ratelimiting.

    We do need to keep the EXPORT_SYMBOL(gssd_running) in place since
    auth_gss.ko needs it and sunrpc.ko provides it. We can however,
    eliminate the gssd_running call in the nfs code since that's a bit of a
    layering violation.

    Signed-off-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Jeff Layton
     

21 Jan, 2014

1 commit


19 Jan, 2014

1 commit

  • Both nfs41_walk_client_list and nfs40_walk_client_list expect the
    'status' variable to be set to the value -NFS4ERR_STALE_CLIENTID
    if the loop fails to find a match.
    The problem is that the 'pos->cl_cons_state > NFS_CS_READY' changes
    the value of 'status', and sets it either to the value '0' (which
    indicates success), or to the value EINTR.

    Cc: stable@vger.kernel.org # 3.7.x: 7b1f1fd1842e6: NFSv4/4.1: Fix bugs in
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

07 Dec, 2013

1 commit

  • Currently, the client will attempt to use krb5i in the SETCLIENTID call
    even if rpc.gssd isn't running. When that fails, it'll then fall back to
    RPC_AUTH_UNIX. This introduced a delay when mounting if rpc.gssd isn't
    running, and causes warning messages to pop up in the ring buffer.

    Check to see if rpc.gssd is running before even attempting to use krb5i
    auth, and just silently skip trying to do so if it isn't. In the event
    that the admin is actually trying to mount with krb5*, it will still
    fail at a later stage of the mount attempt.

    Signed-off-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Jeff Layton
     

29 Oct, 2013

7 commits

  • This patch adds support for multiple security options which can be
    specified using a colon-delimited list of security flavors (the same
    syntax as nfsd's exports file).

    This is useful, for instance, when NFSv4.x mounts cross SECINFO
    boundaries. With this patch a user can use "sec=krb5i,krb5p"
    to mount a remote filesystem using krb5i, but can still cross
    into krb5p-only exports.

    New mounts will try all security options before failing. NFSv4.x
    SECINFO results will be compared against the sec= flavors to
    find the first flavor in both lists or if no match is found will
    return -EPERM.

    Signed-off-by: Weston Andros Adamson
    Signed-off-by: Trond Myklebust

    Weston Andros Adamson
     
  • Since the parsed sec= flavor is now stored in nfs_server->auth_info,
    we no longer need an nfs_server flag to determine if a sec= option was
    used.

    This flag has not been completely removed because it is still needed for
    the (old but still supported) non-text parsed mount options ABI
    compatability.

    Signed-off-by: Weston Andros Adamson
    Signed-off-by: Trond Myklebust

    Weston Andros Adamson
     
  • Cache the auth_info structure in nfs_server and pass these values to submounts.

    This lays the groundwork for supporting multiple sec= options.

    Signed-off-by: Weston Andros Adamson
    Signed-off-by: Trond Myklebust

    Weston Andros Adamson
     
  • When filling parsed_mount_data, store the parsed sec= mount option in
    the new struct nfs_auth_info and the chosen flavor in selected_flavor.

    This patch lays the groundwork for supporting multiple sec= options.

    Signed-off-by: Weston Andros Adamson
    Signed-off-by: Trond Myklebust

    Weston Andros Adamson
     
  • Migration recovery and state recovery must be serialized, so handle
    both in the state manager thread.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Allow code in nfsv4.ko to use _nfs_display_fhandle().

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • New function nfs4_update_server() moves an nfs_server to a different
    nfs_client. This is done as part of migration recovery.

    Though it may be appealing to think of them as the same thing,
    migration recovery is not the same as following a referral.

    For a referral, the client has not descended into the file system
    yet: it has no nfs_server, no super block, no inodes or open state.
    It is enough to simply instantiate the nfs_server and super block,
    and perform a referral mount.

    For a migration, however, we have all of those things already, and
    they have to be moved to a different nfs_client. No local namespace
    changes are needed here.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

02 Oct, 2013

1 commit


08 Sep, 2013

2 commits


07 Sep, 2013

1 commit

  • Commit 4edaa308 "NFS: Use "krb5i" to establish NFSv4 state whenever possible"
    uses the nfs_client cl_rpcclient for all state management operations, and
    will use krb5i or auth_sys with no regard to the mount command authflavor
    choice.

    The MDS, as any NFSv4.1 mount point, uses the nfs_server rpc client for all
    non-state management operations with a different nfs_server for each fsid
    encountered traversing the mount point, each with a potentially different
    auth flavor.

    pNFS data servers are not mounted in the normal sense as there is no associated
    nfs_server structure. Data servers can also export multiple fsids, each with
    a potentially different auth flavor.

    Data servers need to use the same authflavor as the MDS server rpc client for
    non-state management operations. Populate a list of rpc clients with the MDS
    server rpc client auth flavor for the DS to use.

    Signed-off-by: Andy Adamson
    Signed-off-by: Trond Myklebust

    Andy Adamson
     

04 Sep, 2013

1 commit


08 Aug, 2013

1 commit