27 May, 2020

1 commit


25 Jan, 2020

1 commit


15 Jan, 2020

4 commits

  • We find a bug when running test under nfsv3  as below.
    1)
    chacl u::r--,g::rwx,o:rw- file1
    2)
    chmod u+w file1
    3)
    chacl -l file1

    We expect u::rw-, but it shows u::r--, more likely it returns the
    cached acl in inode.

    We dig the code find that the code path is different.

    chacl->..->__nfs3_proc_setacls->nfs_zap_acl_cache
    Then nfs_zap_acl_cache clears the NFS_INO_INVALID_ACL in
    NFS_I(inode)->cache_validity.

    chmod->..->nfs3_proc_setattr
    Because NFS_INO_INVALID_ACL has been cleared by chacl path,
    nfs_zap_acl_cache wont be called.

    nfs_setattr_update_inode will set NFS_INO_INVALID_ACL so let it
    before nfs_zap_acl_cache call.

    Signed-off-by: Su Yanjun
    Signed-off-by: Anna Schumaker

    Su Yanjun
     
  • Add a mount option 'softreval' that allows attribute revalidation 'getattr'
    calls to time out, and causes them to fall back to using the cached
    attributes.
    The use case for this option is for ensuring that we can still (slowly)
    traverse paths and use cached information even when the server is down.
    Once the server comes back up again, the getattr calls start succeeding,
    and the caches will revalidate as usual.

    The 'softreval' mount option is automatically enabled if you have
    specified 'softerr'. It can be turned off using the options
    'nosoftreval', or 'hard'.

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

    Trond Myklebust
     
  • In nfs3_proc_lookup, if nfs_alloc_fattr fails, will only print
    "NFS call lookup". This may be confusing, move dprintk after
    nfs_alloc_fattr.

    Reported-by: Hulk Robot
    Signed-off-by: zhengbin
    Signed-off-by: Anna Schumaker

    zhengbin
     
  • Add filesystem context support to NFS, parsing the options in advance and
    attaching the information to struct nfs_fs_context. The highlights are:

    (*) Merge nfs_mount_info and nfs_clone_mount into nfs_fs_context. This
    structure represents NFS's superblock config.

    (*) Make use of the VFS's parsing support to split comma-separated lists

    (*) Pin the NFS protocol module in the nfs_fs_context.

    (*) Attach supplementary error information to fs_context. This has the
    downside that these strings must be static and can't be formatted.

    (*) Remove the auxiliary file_system_type structs since the information
    necessary can be conveyed in the nfs_fs_context struct instead.

    (*) Root mounts are made by duplicating the config for the requested mount
    so as to have the same parameters. Submounts pick up their parameters
    from the parent superblock.

    [AV -- retrans is u32, not string]
    [SM -- Renamed cfg to ctx in a few functions in an earlier patch]
    [SM -- Moved fs_context mount option parsing to an earlier patch]
    [SM -- Moved fs_context error logging to a later patch]
    [SM -- Fixed printks in nfs4_try_get_tree() and nfs4_get_referral_tree()]
    [SM -- Added is_remount_fc() helper]
    [SM -- Deferred some refactoring to a later patch]
    [SM -- Fixed referral mounts, which were broken in the original patch]
    [SM -- Fixed leak of nfs_fattr when fs_context is freed]

    Signed-off-by: David Howells
    Signed-off-by: Al Viro
    Signed-off-by: Scott Mayhew
    Signed-off-by: Anna Schumaker

    David Howells
     

21 Sep, 2019

1 commit


20 Dec, 2018

3 commits

  • 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
     
  • Use the common 'struct cred' to pass credentials for readdir.

    Signed-off-by: NeilBrown
    Signed-off-by: Anna Schumaker

    NeilBrown
     
  • Rather than keying the access cache with 'struct rpc_cred',
    use 'struct cred'. Then use cred_fscmp() to compare
    credentials rather than comparing the raw pointer.

    A benefit of this approach is that in the common case we avoid the
    rpc_lookup_cred_nonblock() call which can be slow when the cred cache is large.
    This also keeps many fewer items pinned in the rpc cred cache, so the
    cred cache is less likely to get large.

    Signed-off-by: NeilBrown
    Signed-off-by: Anna Schumaker

    NeilBrown
     

01 Oct, 2018

1 commit


05 Jun, 2018

1 commit


01 Jun, 2018

3 commits


11 Apr, 2018

5 commits


23 Feb, 2018

1 commit

  • The structure nlmclnt_fl_close_lock_ops s local to the source and does
    not need to be in global scope, so make it static.

    Cleans up sparse warning:
    fs/nfs/nfs3proc.c:876:33: warning: symbol 'nlmclnt_fl_close_lock_ops' was not
    declared. Should it be static?

    Signed-off-by: Colin Ian King
    Signed-off-by: Trond Myklebust

    Colin Ian King
     

18 Nov, 2017

1 commit

  • 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
     

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
     

17 Oct, 2017

1 commit


21 Jul, 2017

1 commit


14 Jul, 2017

1 commit

  • NFS uses some int, and unsigned int :1, and bool as flags in structs and
    args. Assert the preference for uniformly replacing these with the bool
    type.

    Signed-off-by: Benjamin Coddington
    Signed-off-by: Anna Schumaker

    Benjamin Coddington
     

26 Apr, 2017

1 commit


21 Apr, 2017

2 commits

  • NFS attempts to wait for read and write completion before unlocking in
    order to ensure that the data returned was protected by the lock. When
    this waiting is interrupted by a signal, the unlock may be skipped, and
    messages similar to the following are seen in the kernel ring buffer:

    [20.167876] Leaked locks on dev=0x0:0x2b ino=0x8dd4c3:
    [20.168286] POSIX: fl_owner=ffff880078b06940 fl_flags=0x1 fl_type=0x0 fl_pid=20183
    [20.168727] POSIX: fl_owner=ffff880078b06680 fl_flags=0x1 fl_type=0x0 fl_pid=20185

    For NFSv3, the missing unlock will cause the server to refuse conflicting
    locks indefinitely. For NFSv4, the leftover lock will be removed by the
    server after the lease timeout.

    This patch fixes this issue by skipping the usual wait in
    nfs_iocounter_wait if the FL_CLOSE flag is set when signaled. Instead, the
    wait happens in the unlock RPC task on the NFS UOC rpc_waitqueue.

    For NFSv3, use lockd's new nlmclnt_operations along with
    nfs_async_iocounter_wait to defer NLM's unlock task until the lock
    context's iocounter reaches zero.

    For NFSv4, call nfs_async_iocounter_wait() directly from unlock's
    current rpc_call_prepare.

    Signed-off-by: Benjamin Coddington
    Reviewed-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Benjamin Coddington
     
  • NFS would enjoy the ability to modify the behavior of the NLM client's
    unlock RPC task in order to delay the transmission of the unlock until IO
    that was submitted under that lock has completed. This ability can ensure
    that the NLM client will always complete the transmission of an unlock even
    if the waiting caller has been interrupted with fatal signal.

    For this purpose, a pointer to a struct nlmclnt_operations can be assigned
    in a nfs_module's nfs_rpc_ops that will install those nlmclnt_operations on
    the nlm_host. The struct nlmclnt_operations defines three callback
    operations that will be used in a following patch:

    nlmclnt_alloc_call - used to call back after a successful allocation of
    a struct nlm_rqst in nlmclnt_proc().

    nlmclnt_unlock_prepare - used to call back during NLM unlock's
    rpc_call_prepare. The NLM client defers calling rpc_call_start()
    until this callback returns false.

    nlmclnt_release_call - used to call back when the NLM client's struct
    nlm_rqst is freed.

    Signed-off-by: Benjamin Coddington
    Reviewed-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Benjamin Coddington
     

08 Oct, 2016

1 commit


21 Jul, 2016

1 commit


16 Apr, 2015

1 commit


02 Mar, 2015

2 commits

  • Ensure that other operations that race with our write RPC calls
    cannot revert the file size updates that were made on the server.

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

    Trond Myklebust
     
  • Ensure that other operations which raced with our setattr RPC call
    cannot revert the file attribute changes that were made on the server.
    To do so, we artificially bump the attribute generation counter on
    the inode so that all calls to nfs_fattr_init() that precede ours
    will be dropped.

    The motivation for the patch came from Chuck Lever's reports of readaheads
    racing with truncate operations and causing the file size to be reverted.

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

    Trond Myklebust
     

04 Feb, 2015

1 commit


13 Sep, 2014

1 commit


14 Jul, 2014

1 commit

  • * bugfixes:
    NFS: Don't reset pg_moreio in __nfs_pageio_add_request
    NFS: Remove 2 unused variables
    nfs: handle multiple reqs in nfs_wb_page_cancel
    nfs: handle multiple reqs in nfs_page_async_flush
    nfs: change find_request to find_head_request
    nfs: nfs_page should take a ref on the head req
    nfs: mark nfs_page reqs with flag for extra ref
    nfs: only show Posix ACLs in listxattr if actually present

    Conflicts:
    fs/nfs/write.c

    Trond Myklebust
     

09 Jul, 2014

1 commit

  • The big ACL switched nfs to use generic_listxattr, which calls all existing
    ->list handlers. Add a custom .listxattr implementation that only lists
    the ACLs if they actually are present on the given inode.

    Signed-off-by: Christoph Hellwig
    Reported-by: Philippe Troin
    Tested-by: Philippe Troin
    Fixes: 013cdf1088d7 (nfs: use generic posix ACL infrastructure ...)
    Cc: stable@vger.kernel.org # 3.14+
    Signed-off-by: Trond Myklebust

    Christoph Hellwig
     

25 Jun, 2014

1 commit

  • struct nfs_pgio_data only exists as a member of nfs_pgio_header, but is
    passed around everywhere, because there used to be multiple _data structs
    per _header. Many of these functions then use the _data to find a pointer
    to the _header. This patch cleans this up by merging the nfs_pgio_data
    structure into nfs_pgio_header and passing nfs_pgio_header around instead.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Weston Andros Adamson
    Signed-off-by: Trond Myklebust

    Weston Andros Adamson
     

29 May, 2014

1 commit