Skip to content
Permalink
Olga-Kornievsk…
Switch branches/tags

Commits on Apr 15, 2021

  1. sunrpc: provide multipath info in the sysfs directory

    Allow to query xrpt_switch attributes. Currently showing the following
    fields of the rpc_xprt_switch structure: xps_nxprts, xps_nactive,
    xps_queuelen.
    
    Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021
  2. sunrpc: provide transport info in the sysfs directory

    Allow to query transport's attributes. Currently showing following
    fields of the rpc_xprt structure: state, last_used, cong, cwnd,
    max_reqs, min_reqs, num_reqs, sizes of queues binding, sending,
    pending, backlog.
    
    Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021
  3. sunrpc: add dst_attr attributes to the sysfs xprt directory

    Allow to query and set the destination's address of a transport.
    Setting of the destination address is allowed only for TCP or RDMA
    based connections.
    
    Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021
  4. sunrpc: add add sysfs directory per xprt under each xprt_switch

    Add individual transport directories under each transport switch
    group. For instance, for each nconnect=X connections there will be
    a transport directory. Naming conventions also identifies transport
    type -- xprt-<id>-<type> where type is udp, tcp, rdma, local, bc.
    
    Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021
  5. sunrpc: add a symlink from rpc-client directory to the xprt_switch

    An rpc client uses a transport switch and one ore more transports
    associated with that switch. Since transports are shared among
    rpc clients, create a symlink into the xprt_switch directory
    instead of duplicating entries under each rpc client.
    
    Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021
  6. sunrpc: add xprt_switch direcotry to sunrpc's sysfs

    Add xprt_switch directory to the sysfs and create individual
    xprt_swith subdirectories for multipath transport group.
    
    Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021
  7. sunrpc: keep track of the xprt_class in rpc_xprt structure

    We need to keep track of the type for a given transport.
    
    Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021
  8. sunrpc: add IDs to multipath

    This is used to uniquely identify sunrpc multipath objects in /sys.
    
    Signed-off-by: Dan Aloni <dan@kernelim.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021
  9. sunrpc: add xprt id

    This adds a unique identifier for a sunrpc transport in sysfs, which is
    similarly managed to the unique IDs of clients.
    
    Signed-off-by: Dan Aloni <dan@kernelim.com>
    da-x authored and intel-lab-lkp committed Apr 15, 2021
  10. sunrpc: Prepare xs_connect() for taking NULL tasks

    We won't have a task structure when we go to change IP addresses, so
    check for one before calling the WARN_ON() to avoid crashing.
    
    Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
    Anna Schumaker authored and intel-lab-lkp committed Apr 15, 2021
  11. sunrpc: Create per-rpc_clnt sysfs kobjects

    These will eventually have files placed under them for sysfs operations.
    
    Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021
  12. sunrpc: Create a client/ subdirectory in the sunrpc sysfs

    For network namespace separation.
    
    Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021
  13. sunrpc: Create a sunrpc directory under /sys/kernel/

    This is where we'll put per-rpc_client related files
    
    Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
    Olga Kornievskaia authored and intel-lab-lkp committed Apr 15, 2021

Commits on Apr 14, 2021

  1. NFSv42: Don't force attribute revalidation of the copy offload source

    When a copy offload is performed, we do not expect the source file to
    change other than perhaps to see the atime be updated.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 14, 2021
  2. NFSv42: Copy offload should update the file size when appropriate

    If the result of a copy offload or clone operation is to grow the
    destination file size, then we should update it. The reason is that when
    a client holds a delegation, it is authoritative for the file size.
    
    Fixes: 16abd2a ("NFSv4.2: fix client's attribute cache management for copy_file_range")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 14, 2021
  3. SUNRPC: Handle major timeout in xprt_adjust_timeout()

    Currently if a major timeout value is reached, but the minor value has
    not been reached, an ETIMEOUT will not be sent back to the caller.
    This can occur if the v4 server is not responding to requests and
    retrans is configured larger than the default of two.
    
    For example, A TCP mount with a configured timeout value of 50 and a
    retransmission count of 3 to a v4 server which is not responding:
    
    1. Initial value and increment set to 5s, maxval set to 20s, retries at 3
    2. Major timeout is set to 20s, minor timeout set to 5s initially
    3. xport_adjust_timeout() is called after 5s, retry with 10s timeout,
       minor timeout is bumped to 10s
    4. And again after another 10s, 15s total time with minor timeout set
       to 15s
    5. After 20s total time xport_adjust_timeout is called as major timeout is
       reached, but skipped because the minor timeout is not reached
           - After this time the cpu spins continually calling
           	 xport_adjust_timeout() and returning 0 for 10 seconds.
    	 As seen on perf sched:
       	 39243.913182 [0005]  mount.nfs[3794] 4607.938      0.017   9746.863
    6. This continues until the 15s minor timeout condition is reached (in
       this case for 10 seconds). After which the ETIMEOUT is processed
       back to the caller, the cpu spinning stops, and normal operations
       continue
    
    Fixes: 7de62bc ("SUNRPC dont update timeout value on connection reset")
    Signed-off-by: Chris Dion <Christopher.Dion@dell.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Chris Dion authored and Trond Myklebust committed Apr 14, 2021
  4. SUNRPC: Remove trace_xprt_transmit_queued

    This tracepoint can crash when dereferencing snd_task because
    when some transports connect, they put a cookie in that field
    instead of a pointer to an rpc_task.
    
    BUG: KASAN: use-after-free in trace_event_raw_event_xprt_writelock_event+0x141/0x18e [sunrpc]
    Read of size 2 at addr ffff8881a83bd3a0 by task git/331872
    
    CPU: 11 PID: 331872 Comm: git Tainted: G S                5.12.0-rc2-00007-g3ab6e585a7f9 #1453
    Hardware name: Supermicro SYS-6028R-T/X10DRi, BIOS 1.1a 10/16/2015
    Call Trace:
     dump_stack+0x9c/0xcf
     print_address_description.constprop.0+0x18/0x239
     kasan_report+0x174/0x1b0
     trace_event_raw_event_xprt_writelock_event+0x141/0x18e [sunrpc]
     xprt_prepare_transmit+0x8e/0xc1 [sunrpc]
     call_transmit+0x4d/0xc6 [sunrpc]
    
    Fixes: 9ce07ae ("SUNRPC: Replace dprintk() call site in xprt_prepare_transmit")
    Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    chucklever authored and Trond Myklebust committed Apr 14, 2021
  5. SUNRPC: Add tracepoint that fires when an RPC is retransmitted

    A separate tracepoint can be left enabled all the time to capture
    rare but important retransmission events. So for example:
    
    kworker/u26:3-568   [009]   156.967933: xprt_retransmit:      task:44093@5 xid=0xa25dbc79 nfsv3 WRITE ntrans=2
    
    Or, for example, enable all nfs and nfs4 tracepoints, and set up a
    trigger to disable tracing when xprt_retransmit fires to capture
    everything that leads up to it.
    
    Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    chucklever authored and Trond Myklebust committed Apr 14, 2021
  6. SUNRPC: Move fault injection call sites

    I've hit some crashes that occur in the xprt_rdma_inject_disconnect
    path. It appears that, for some provides, rdma_disconnect() can
    take so long that the transport can disconnect and release its
    hardware resources while rdma_disconnect() is still running,
    resulting in a UAF in the provider.
    
    The transport's fault injection method may depend on the stability
    of transport data structures. That means it needs to be invoked
    only from contexts that hold the transport write lock.
    
    Fixes: 4a06825 ("SUNRPC: Transport fault injection")
    Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    chucklever authored and Trond Myklebust committed Apr 14, 2021
  7. NFSv4.2 fix handling of sr_eof in SEEK's reply

    Currently the client ignores the value of the sr_eof of the SEEK
    operation. According to the spec, if the server didn't find the
    requested extent and reached the end of the file, the server
    would return sr_eof=true. In case the request for DATA and no
    data was found (ie in the middle of the hole), then the lseek
    expects that ENXIO would be returned.
    
    Fixes: 1c6dcbe ("NFS: Implement SEEK")
    Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Olga Kornievskaia authored and Trond Myklebust committed Apr 14, 2021
  8. pNFS/flexfiles: fix incorrect size check in decode_nfs_fh()

    We (adam zabrocki, alexander matrosov, alexander tereshkin, maksym
    bazalii) observed the check:
    
    	if (fh->size > sizeof(struct nfs_fh))
    
    should not use the size of the nfs_fh struct which includes an extra two
    bytes from the size field.
    
    struct nfs_fh {
    	unsigned short         size;
    	unsigned char          data[NFS_MAXFHSIZE];
    }
    
    but should determine the size from data[NFS_MAXFHSIZE] so the memcpy
    will not write 2 bytes beyond destination.  The proposed fix is to
    compare against the NFS_MAXFHSIZE directly, as is done elsewhere in fs
    code base.
    
    Fixes: d67ae82 ("pnfs/flexfiles: Add the FlexFile Layout Driver")
    Signed-off-by: Nikola Livic <nlivic@gmail.com>
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Nikola Livic authored and Trond Myklebust committed Apr 14, 2021
  9. NFSv4: Catch and trace server filehandle encoding errors

    If the server returns a filehandle with an invalid length, then trace
    that, and return an EREMOTEIO error.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 14, 2021
  10. NFSv4: Convert nfs_xdr_status tracepoint to an event class

    We would like the ability to record other XDR errors, particularly
    those that are due to server bugs.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 14, 2021
  11. NFSv4: Add tracing for COMPOUND errors

    When the server returns a different operation than we expected, then
    trace that.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 14, 2021
  12. NFS: Split attribute support out from the server capabilities

    There are lots of attributes, and they are crowding out the bit space.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    trondmypd authored and Trond Myklebust committed Apr 14, 2021
  13. NFS: Don't store NFS_INO_REVAL_FORCED

    NFS_INO_REVAL_FORCED is intended to tell us that the cache needs
    revalidation despite the fact that we hold a delegation. We shouldn't
    need to store it anymore, though.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 14, 2021
  14. NFSv4: link must update the inode nlink.

    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 14, 2021
  15. NFSv4: nfs4_inc/dec_nlink_locked should also invalidate ctime

    If the nlink changes, then so will the ctime.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 14, 2021

Commits on Apr 13, 2021

  1. NFS: Another inode revalidation improvement

    If we're trying to update the inode because a previous update left the
    cache in a partially unrevalidated state, then allow the update if the
    change attrs match.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 13, 2021
  2. NFS: Use information about the change attribute to optimise updates

    If the NFSv4.2 server supports the 'change_attr_type' attribute, then
    allow the client to optimise its attribute cache update strategy.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 13, 2021
  3. NFSv4: Add support for the NFSv4.2 "change_attr_type" attribute

    The change_attr_type allows the server to provide a description of how
    the change attribute will behave. This again will allow the client to
    optimise its behaviour w.r.t. attribute revalidation.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 13, 2021
  4. NFSv4: Don't modify the change attribute cached in the inode

    When the client is caching data and a write delegation is held, then the
    server may send a CB_GETATTR to query the attributes. When this happens,
    the client is supposed to bump the change attribute value that it
    returns if it holds cached data.
    However that process uses a value that is stored in the delegation. We
    do not want to bump the change attribute held in the inode.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 13, 2021
  5. NFSv4: Fix value of decode_fsinfo_maxsz

    At least two extra fields have been added to fsinfo since this was last
    updated.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 13, 2021
  6. NFS: Simplify cache consistency in nfs_check_inode_attributes()

    We should not be invalidating the access or acl caches in
    nfs_check_inode_attributes(), since the point is we're unsure about
    whether the contents of the struct nfs_fattr are fully up to date.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 13, 2021
  7. NFS: Remove a line of code that has no effect in nfs_update_inode()

    Commit 0b46726 ("NFS: Fix attribute revalidation") changed the way
    we populate the 'invalid' attribute, and made the line that strips away
    the NFS_INO_INVALID_ATTR bits redundant.
    
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Trond Myklebust committed Apr 13, 2021
Older