26 Mar, 2020

1 commit


02 Mar, 2019

9 commits


20 Dec, 2018

1 commit

  • SUNRPC has two sorts of credentials, both of which appear as
    "struct rpc_cred".
    There are "generic credentials" which are supplied by clients
    such as NFS and passed in 'struct rpc_message' to indicate
    which user should be used to authorize the request, and there
    are low-level credentials such as AUTH_NULL, AUTH_UNIX, AUTH_GSS
    which describe the credential to be sent over the wires.

    This patch replaces all the generic credentials by 'struct cred'
    pointers - the credential structure used throughout Linux.

    For machine credentials, there is a special 'struct cred *' pointer
    which is statically allocated and recognized where needed as
    having a special meaning. A look-up of a low-level cred will
    map this to a machine credential.

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

    NeilBrown
     

23 Nov, 2018

1 commit

  • rfc8435 says:

    For tight coupling, ffds_stateid provides the stateid to be used by
    the client to access the file.

    However current implementation replaces per-mirror provided stateid with
    by open or lock stateid.

    Ensure that per-mirror stateid is used by ff_layout_write_prepare_v4 and
    nfs4_ff_layout_prepare_ds.

    Signed-off-by: Tigran Mkrtchyan
    Signed-off-by: Rick Macklem
    Signed-off-by: Trond Myklebust

    Tigran Mkrtchyan
     

18 Nov, 2017

2 commits

  • Pull NFS client updates from Anna Schumaker:
    "Stable bugfixes:
    - Revalidate "." and ".." correctly on open
    - Avoid RCU usage in tracepoints
    - Fix ugly referral attributes
    - Fix a typo in nomigration mount option
    - Revert "NFS: Move the flock open mode check into nfs_flock()"

    Features:
    - Implement a stronger send queue accounting system for NFS over RDMA
    - Switch some atomics to the new refcount_t type

    Other bugfixes and cleanups:
    - Clean up access mode bits
    - Remove special-case revalidations in nfs_opendir()
    - Improve invalidating NFS over RDMA memory for async operations that
    time out
    - Handle NFS over RDMA replies with a worqueue
    - Handle NFS over RDMA sends with a workqueue
    - Fix up replaying interrupted requests
    - Remove dead NFS over RDMA definitions
    - Update NFS over RDMA copyright information
    - Be more consistent with bool initialization and comparisons
    - Mark expected switch fall throughs
    - Various sunrpc tracepoint cleanups
    - Fix various OPEN races
    - Fix a typo in nfs_rename()
    - Use common error handling code in nfs_lock_and_join_request()
    - Check that some structures are properly cleaned up during
    net_exit()
    - Remove net pointer from dprintk()s"

    * tag 'nfs-for-4.15-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (62 commits)
    NFS: Revert "NFS: Move the flock open mode check into nfs_flock()"
    NFS: Fix typo in nomigration mount option
    nfs: Fix ugly referral attributes
    NFS: super: mark expected switch fall-throughs
    sunrpc: remove net pointer from messages
    nfs: remove net pointer from messages
    sunrpc: exit_net cleanup check added
    nfs client: exit_net cleanup check added
    nfs/write: Use common error handling code in nfs_lock_and_join_requests()
    NFSv4: Replace closed stateids with the "invalid special stateid"
    NFSv4: nfs_set_open_stateid must not trigger state recovery for closed state
    NFSv4: Check the open stateid when searching for expired state
    NFSv4: Clean up nfs4_delegreturn_done
    NFSv4: cleanup nfs4_close_done
    NFSv4: Retry NFS4ERR_OLD_STATEID errors in layoutreturn
    pNFS: Retry NFS4ERR_OLD_STATEID errors in layoutreturn-on-close
    NFSv4: Don't try to CLOSE if the stateid 'other' field has changed
    NFSv4: Retry CLOSE and DELEGRETURN on NFS4ERR_OLD_STATEID.
    NFS: Fix a typo in nfs_rename()
    NFSv4: Fix open create exclusive when the server reboots
    ...

    Linus Torvalds
     
  • atomic_t variables are currently used to implement reference
    counters with the following properties:
    - counter is initialized to 1 using atomic_set()
    - a resource is freed upon counter reaching zero
    - once counter reaches zero, its further
    increments aren't allowed
    - counter schema uses basic atomic operations
    (set, inc, inc_not_zero, dec_and_test, etc.)

    Such atomic variables should be converted to a newly provided
    refcount_t type and API that prevents accidental counter overflows
    and underflows. This is important since overflows and underflows
    can lead to use-after-free situation and be exploitable.

    The variable nfs4_ff_layout_mirror.ref is used as pure reference counter.
    Convert it to refcount_t and fix up the operations.

    Suggested-by: Kees Cook
    Reviewed-by: David Windsor
    Reviewed-by: Hans Liljestrand
    Signed-off-by: Elena Reshetova
    Signed-off-by: Anna Schumaker

    Elena Reshetova
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

18 Mar, 2017

1 commit

  • The flexfiles layout should never mark a device unavailable.

    Move nfs4_mark_deviceid_unavailable out of nfs4_pnfs_ds_connect and call
    directly from files layout where it's still needed.

    The flexfiles driver still handles marked devices in error paths, but will
    now print a rate limited warning.

    Signed-off-by: Weston Andros Adamson
    Signed-off-by: Anna Schumaker

    Weston Andros Adamson
     

10 Dec, 2016

1 commit


09 Dec, 2016

1 commit

  • We encountered a deadlock where the SEQUENCE that accompanied the
    LAYOUTGET triggered a session drain, while ff_layout_alloc_lseg
    triggered a GETDEVICEINFO. The GETDEVICEINFO hung waiting for the
    session drain, while the LAYOUTGET held the slot waiting for
    alloc_lseg to finish.
    Avoid this by moving the call to nfs4_find_get_deviceid out of
    ff_layout_alloc_lseg and into nfs4_ff_layout_prepare_ds.

    Signed-off-by: Fred Isaman
    [dros@primarydata.com: pNFS/flexfiles: fix races in ff_layout_mirror_valid]
    Signed-off-by: Weston Andros Adamson
    Signed-off-by: Trond Myklebust

    Fred Isaman
     

04 Dec, 2016

2 commits


03 Dec, 2016

1 commit


15 Aug, 2016

1 commit

  • Putting the periodicity timer in the mirror instances is causing
    non-scalable reporting behaviour and missed reporting intervals.
    When you recall layouts and/or implement client side mirroring, it
    leads to consecutive reports with only a few ms between RPC calls.

    Signed-off-by: Trond Myklebust
    Fixes: d0379a5d066a9 ("pNFS/flexfiles: Support server-supplied...")

    Trond Myklebust
     

26 May, 2016

1 commit


18 May, 2016

1 commit


09 May, 2016

2 commits

  • A mirror can be shared between multiple layouts, even with different
    iomodes. That makes stats gathering simpler, but it causes a problem
    when we get different creds in READ vs. RW layouts.

    The current code drops the newer credentials onto the floor when this
    occurs. That's problematic when you fetch a READ layout first, and then
    a RW. If the READ layout doesn't have the correct creds to do a write,
    then writes will fail.

    We could just overwrite the READ credentials with the RW ones, but that
    would break the ability for the server to fence the layout for reads if
    things go awry. We need to be able to revert to the earlier READ creds
    if the RW layout is returned afterward.

    The simplest fix is to just keep two sets of creds per mirror. One for
    READ layouts and one for RW, and then use the appropriate set depending
    on the iomode of the layout segment.

    Also fix up some RCU nits that sparse found.

    Signed-off-by: Jeff Layton
    Signed-off-by: Anna Schumaker

    Jeff Layton
     
  • We're just as likely to have allocation problems here as we would if we
    delay looking up the credential like we currently do. Fix the code to
    get a rpc_cred reference early, as soon as the mirror is set up.

    This allows us to eliminate the mirror early if there is a problem
    getting an rpc credential. This also allows us to drop the uid/gid
    from the layout_mirror struct as well.

    In the event that we find an existing mirror where this one would go, we
    swap in the new creds unconditionally, and drop the reference to the old
    one.

    Note that the old ff_layout_update_mirror_cred function wouldn't set
    this pointer unless the DS version was 3, but we don't know what the DS
    version is at this point. I'm a little unclear on why it did that as you
    still need creds to talk to v4 servers as well. I have the code set
    it regardless of the DS version here.

    Also note the change to using generic creds instead of calling
    lookup_cred directly. With that change, we also need to populate the
    group_info pointer in the acred as some functions expect that to never
    be NULL. Instead of allocating one every time however, we can allocate
    one when the module is loaded and share it since the group_info is
    refcounted.

    Signed-off-by: Jeff Layton
    Signed-off-by: Anna Schumaker

    Jeff Layton
     

29 Dec, 2015

1 commit


03 Nov, 2015

1 commit

  • For loosely coupled pNFS/flexfiles systems, there is often no advantage
    at all in going through the MDS for I/O, since the MDS is subject to
    the same limitations as all other clients when talking to DSes. If a
    DS is unresponsive, I/O through the MDS will fail.

    For such systems, the only scalable solution is to have the pNFS clients
    retry doing pNFS, and so the protocol now provides a flag that allows
    the pNFS server to signal this.

    If LAYOUTGET returns FF_FLAGS_NO_IO_THRU_MDS, then we should assume that
    the MDS wants the client to retry using these devices, even if they were
    previously marked as being unavailable. To do so, we add a helper,
    ff_layout_mark_devices_valid() that will be called from layoutget.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

26 Aug, 2015

3 commits


27 Jun, 2015

1 commit

  • This patch ensures that we record the value of 'ffl_flags' from
    the layout, and then checks for the presence of the
    FF_FLAGS_NO_LAYOUTCOMMIT flag before deciding whether or not to
    call pnfs_set_layoutcommit().

    The effect is that servers now can decide whether or not they want
    the client to call layoutcommit before returning a writeable layout.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

24 Jun, 2015

5 commits


04 Feb, 2015

1 commit

  • The flexfile layout is a new layout that extends the
    file layout. It is currently being drafted as a specification at
    https://datatracker.ietf.org/doc/draft-ietf-nfsv4-layout-types/

    Signed-off-by: Weston Andros Adamson
    Signed-off-by: Tom Haynes
    Signed-off-by: Tao Peng

    Tom Haynes