14 Jul, 2016

1 commit

  • This addresses the conundrum referenced in RFC5661 18.35.3,
    and will allow clients to return state to the server using the
    machine credentials.

    The biggest part of the problem is that we need to allow the client
    to send a compound op with integrity/privacy on mounts that don't
    have it enabled.

    Add server support for properly decoding and using spo_must_enforce
    and spo_must_allow bits. Add support for machine credentials to be
    used for CLOSE, OPEN_DOWNGRADE, LOCKU, DELEGRETURN,
    and TEST/FREE STATEID.
    Implement a check so as to not throw WRONGSEC errors when these
    operations are used if integrity/privacy isn't turned on.

    Without this, Linux clients with credentials that expired while holding
    delegations were getting stuck in an endless loop.

    Signed-off-by: Andrew Elble
    Reviewed-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Andrew Elble
     

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
     

03 Feb, 2015

1 commit

  • Add support for the GETDEVICEINFO, LAYOUTGET, LAYOUTCOMMIT and
    LAYOUTRETURN NFSv4.1 operations, as well as backing code to manage
    outstanding layouts and devices.

    Layout management is very straight forward, with a nfs4_layout_stateid
    structure that extends nfs4_stid to manage layout stateids as the
    top-level structure. It is linked into the nfs4_file and nfs4_client
    structures like the other stateids, and contains a linked list of
    layouts that hang of the stateid. The actual layout operations are
    implemented in layout drivers that are not part of this commit, but
    will be added later.

    The worst part of this commit is the management of the pNFS device IDs,
    which suffers from a specification that is not sanely implementable due
    to the fact that the device-IDs are global and not bound to an export,
    and have a small enough size so that we can't store the fsid portion of
    a file handle, and must never be reused. As we still do need perform all
    export authentication and validation checks on a device ID passed to
    GETDEVICEINFO we are caught between a rock and a hard place. To work
    around this issue we add a new hash that maps from a 64-bit integer to a
    fsid so that we can look up the export to authenticate against it,
    a 32-bit integer as a generation that we can bump when changing the device,
    and a currently unused 32-bit integer that could be used in the future
    to handle more than a single device per export. Entries in this hash
    table are never deleted as we can't reuse the ids anyway, and would have
    a severe lifetime problem anyway as Linux export structures are temporary
    structures that can go away under load.

    Parts of the XDR data, structures and marshaling/unmarshaling code, as
    well as many concepts are derived from the old pNFS server implementation
    from Andy Adamson, Benny Halevy, Dean Hildebrand, Marc Eshel, Fred Isaman,
    Mike Sager, Ricardo Labiaga and many others.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     

20 Nov, 2014

1 commit


29 Aug, 2014

1 commit

  • Recent NFS v4.2 drafts have removed NFS4ERR_METADATA_NOTSUPP and
    reassigned the error code to NFS4ERR_UNION_NOTSUPP.

    I also add in the NFS4ERR_OFFLOAD_NO_REQS error code.

    We're not using any of these yet, so there's no harm done.

    Signed-off-by: Anna Schumaker
    Signed-off-by: J. Bruce Fields

    Anna Schumaker
     

09 May, 2014

1 commit


07 May, 2014

4 commits


28 Mar, 2014

1 commit


13 Jul, 2013

1 commit

  • You can turn on or off support for minorversions using e.g.

    echo "-4.2" >/proc/fs/nfsd/versions

    However, the current implementation is a little wonky. For example, the
    above will turn off 4.2 support, but it will also turn *on* 4.1 support.

    This didn't matter as long as we only had 2 minorversions, which was
    true till very recently.

    And do a little cleanup here.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

15 May, 2013

1 commit

  • Implement labeled NFS on the server: encoding and decoding, and writing
    and reading, of file labels.

    Enabled with CONFIG_NFSD_V4_SECURITY_LABEL.

    Signed-off-by: Matthew N. Dodd
    Signed-off-by: Miguel Rodel Felipe
    Signed-off-by: Phua Eu Gene
    Signed-off-by: Khin Mi Mi Aung
    Signed-off-by: J. Bruce Fields

    David Quigley
     

13 May, 2013

2 commits

  • This enables NFSv4.2 support for the server. To enable this
    code do the following:
    echo "+4.2" >/proc/fs/nfsd/versions

    after the nfsd kernel module is loaded.

    On its own this does nothing except allow the server to respond to
    compounds with minorversion set to 2. All the new NFSv4.2 features are
    optional, so this is perfectly legal.

    Signed-off-by: Steve Dickson
    Signed-off-by: J. Bruce Fields

    Steve Dickson
     
  • Signed-off-by: Matthew N. Dodd
    Signed-off-by: Miguel Rodel Felipe
    Signed-off-by: Phua Eu Gene
    Signed-off-by: Khin Mi Mi Aung
    Signed-off-by: Steve Dickson
    Signed-off-by: J. Bruce Fields

    Steve Dickson
     

24 Feb, 2013

1 commit


11 Dec, 2012

5 commits


28 Nov, 2012

3 commits


22 Aug, 2012

1 commit


21 Aug, 2012

1 commit


25 Jul, 2012

2 commits


11 Jul, 2012

1 commit


29 Mar, 2012

1 commit

  • Otherwise, we get a warning or error similar to this when building with
    CONFIG_NFSD_V4 disabled:

    ERROR: "nfsd4_cld_block" [fs/nfsd/nfsd.ko] undefined!

    Fix this by wrapping the calls to rpc_pipefs_notifier_register and
    ..._unregister in another function and providing no-op replacements
    when CONFIG_NFSD_V4 is disabled.

    Reported-by: Paul Gortmaker
    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     

08 Nov, 2011

2 commits


14 Sep, 2011

1 commit


27 Aug, 2011

1 commit


05 Jan, 2011

1 commit


12 Oct, 2010

1 commit

  • Expire clients more promptly, at the expense of possibly running the
    laundromat thread more frequently.

    Though it's not the default, I'd like it to be feasible to run with a
    lease time of just a few seconds, at which point a minimum 10 second
    wait between laundromat runs seems a little much.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

30 Jul, 2010

1 commit

  • The vfs doesn't really allow us to "upgrade" a file descriptor from
    read-only to read-write, and our attempt to do so in nfs4_upgrade_open
    is ugly and incomplete.

    Move to a different scheme where we keep multiple opens, shared between
    open stateid's, in the nfs4_file struct. Each file will be opened at
    most 3 times (for read, write, and read-write), and those opens will be
    shared between all clients and openers. On upgrade we will do another
    open if necessary instead of attempting to upgrade an existing open.
    We keep count of the number of readers and writers so we know when to
    close the shared files.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

07 Mar, 2010

2 commits


16 Dec, 2009

1 commit