1. 03 Jun, 2020 1 commit
  2. 01 Jun, 2020 1 commit
    • J. Bruce Fields's avatar
      nfsd4: make drc_slab global, not per-net · 027690c7
      J. Bruce Fields authored
      I made every global per-network-namespace instead.  But perhaps doing
      that to this slab was a step too far.
      
      The kmem_cache_create call in our net init method also seems to be
      responsible for this lockdep warning:
      
      [   45.163710] Unable to find swap-space signature
      [   45.375718] trinity-c1 (855): attempted to duplicate a private mapping with mremap.  This is not supported.
      [   46.055744] futex_wake_op: trinity-c1 tries to shift op by -209; fix this program
      [   51.011723]
      [   51.013378] ======================================================
      [   51.013875] WARNING: possible circular locking dependency detected
      [   51.014378] 5.2.0-rc2 #1 Not tainted
      [   51.014672] ------------------------------------------------------
      [   51.015182] trinity-c2/886 is trying to acquire lock:
      [   51.015593] 000000005405f099 (slab_mutex){+.+.}, at: slab_attr_store+0xa2/0x130
      [   51.016190]
      [   51.016190] but task is already holding lock:
      [   51.016652] 00000000ac662005 (kn->count#43){++++}, at: kernfs_fop_write+0x286/0x500
      [   51.017266]
      [   51.017266] which lock already depends on the new lock.
      [   51.017266]
      [   51.017909]
      [   51.017909] the existing dependency chain (in reverse order) is:
      [   51.018497]
      [   51.018497] -> #1 (kn->count#43){++++}:
      [   51.018956]        __lock_acquire+0x7cf/0x1a20
      [   51.019317]        lock_acquire+0x17d/0x390
      [   51.019658]        __kernfs_remove+0x892/0xae0
      [   51.020020]        kernfs_remove_by_name_ns+0x78/0x110
      [   51.020435]        sysfs_remove_link+0x55/0xb0
      [   51.020832]        sysfs_slab_add+0xc1/0x3e0
      [   51.021332]        __kmem_cache_create+0x155/0x200
      [   51.021720]        create_cache+0xf5/0x320
      [   51.022054]        kmem_cache_create_usercopy+0x179/0x320
      [   51.022486]        kmem_cache_create+0x1a/0x30
      [   51.022867]        nfsd_reply_cache_init+0x278/0x560
      [   51.023266]        nfsd_init_net+0x20f/0x5e0
      [   51.023623]        ops_init+0xcb/0x4b0
      [   51.023928]        setup_net+0x2fe/0x670
      [   51.024315]        copy_net_ns+0x30a/0x3f0
      [   51.024653]        create_new_namespaces+0x3c5/0x820
      [   51.025257]        unshare_nsproxy_namespaces+0xd1/0x240
      [   51.025881]        ksys_unshare+0x506/0x9c0
      [   51.026381]        __x64_sys_unshare+0x3a/0x50
      [   51.026937]        do_syscall_64+0x110/0x10b0
      [   51.027509]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [   51.028175]
      [   51.028175] -> #0 (slab_mutex){+.+.}:
      [   51.028817]        validate_chain+0x1c51/0x2cc0
      [   51.029422]        __lock_acquire+0x7cf/0x1a20
      [   51.029947]        lock_acquire+0x17d/0x390
      [   51.030438]        __mutex_lock+0x100/0xfa0
      [   51.030995]        mutex_lock_nested+0x27/0x30
      [   51.031516]        slab_attr_store+0xa2/0x130
      [   51.032020]        sysfs_kf_write+0x11d/0x180
      [   51.032529]        kernfs_fop_write+0x32a/0x500
      [   51.033056]        do_loop_readv_writev+0x21d/0x310
      [   51.033627]        do_iter_write+0x2e5/0x380
      [   51.034148]        vfs_writev+0x170/0x310
      [   51.034616]        do_pwritev+0x13e/0x160
      [   51.035100]        __x64_sys_pwritev+0xa3/0x110
      [   51.035633]        do_syscall_64+0x110/0x10b0
      [   51.036200]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [   51.036924]
      [   51.036924] other info that might help us debug this:
      [   51.036924]
      [   51.037876]  Possible unsafe locking scenario:
      [   51.037876]
      [   51.038556]        CPU0                    CPU1
      [   51.039130]        ----                    ----
      [   51.039676]   lock(kn->count#43);
      [   51.040084]                                lock(slab_mutex);
      [   51.040597]                                lock(kn->count#43);
      [   51.041062]   lock(slab_mutex);
      [   51.041320]
      [   51.041320]  *** DEADLOCK ***
      [   51.041320]
      [   51.041793] 3 locks held by trinity-c2/886:
      [   51.042128]  #0: 000000001f55e152 (sb_writers#5){.+.+}, at: vfs_writev+0x2b9/0x310
      [   51.042739]  #1: 00000000c7d6c034 (&of->mutex){+.+.}, at: kernfs_fop_write+0x25b/0x500
      [   51.043400]  #2: 00000000ac662005 (kn->count#43){++++}, at: kernfs_fop_write+0x286/0x500
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Fixes: 3ba75830 "drc containerization"
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      027690c7
  3. 28 May, 2020 5 commits
  4. 21 May, 2020 1 commit
    • J. Bruce Fields's avatar
      Merge branch 'nfsd-5.8' of git://linux-nfs.org/~cel/cel-2.6 into for-5.8-incoming · 6670ee2e
      J. Bruce Fields authored
      Highlights of this series:
      * Remove serialization of sending RPC/RDMA Replies
      * Convert the TCP socket send path to use xdr_buf::bvecs (pre-requisite for
      RPC-on-TLS)
      * Fix svcrdma backchannel sendto return code
      * Convert a number of dprintk call sites to use tracepoints
      * Fix the "suggest braces around empty body in an 'else' statement" warning
      6670ee2e
  5. 20 May, 2020 12 commits
    • Chuck Lever's avatar
      NFSD: Fix improperly-formatted Doxygen comments · f2453978
      Chuck Lever authored
      fs/nfsd/nfsctl.c:256: warning: Function parameter or member 'file' not described in 'write_unlock_ip'
      fs/nfsd/nfsctl.c:256: warning: Function parameter or member 'buf' not described in 'write_unlock_ip'
      fs/nfsd/nfsctl.c:256: warning: Function parameter or member 'size' not described in 'write_unlock_ip'
      fs/nfsd/nfsctl.c:295: warning: Function parameter or member 'file' not described in 'write_unlock_fs'
      fs/nfsd/nfsctl.c:295: warning: Function parameter or member 'buf' not described in 'write_unlock_fs'
      fs/nfsd/nfsctl.c:295: warning: Function parameter or member 'size' not described in 'write_unlock_fs'
      fs/nfsd/nfsctl.c:352: warning: Function parameter or member 'file' not described in 'write_filehandle'
      fs/nfsd/nfsctl.c:352: warning: Function parameter or member 'buf' not described in 'write_filehandle'
      fs/nfsd/nfsctl.c:352: warning: Function parameter or member 'size' not described in 'write_filehandle'
      fs/nfsd/nfsctl.c:434: warning: Function parameter or member 'file' not described in 'write_threads'
      fs/nfsd/nfsctl.c:434: warning: Function parameter or member 'buf' not described in 'write_threads'
      fs/nfsd/nfsctl.c:434: warning: Function parameter or member 'size' not described in 'write_threads'
      fs/nfsd/nfsctl.c:478: warning: Function parameter or member 'file' not described in 'write_pool_threads'
      fs/nfsd/nfsctl.c:478: warning: Function parameter or member 'buf' not described in 'write_pool_threads'
      fs/nfsd/nfsctl.c:478: warning: Function parameter or member 'size' not described in 'write_pool_threads'
      fs/nfsd/nfsctl.c:697: warning: Function parameter or member 'file' not described in 'write_versions'
      fs/nfsd/nfsctl.c:697: warning: Function parameter or member 'buf' not described in 'write_versions'
      fs/nfsd/nfsctl.c:697: warning: Function parameter or member 'size' not described in 'write_versions'
      fs/nfsd/nfsctl.c:858: warning: Function parameter or member 'file' not described in 'write_ports'
      fs/nfsd/nfsctl.c:858: warning: Function parameter or member 'buf' not described in 'write_ports'
      fs/nfsd/nfsctl.c:858: warning: Function parameter or member 'size' not described in 'write_ports'
      fs/nfsd/nfsctl.c:892: warning: Function parameter or member 'file' not described in 'write_maxblksize'
      fs/nfsd/nfsctl.c:892: warning: Function parameter or member 'buf' not described in 'write_maxblksize'
      fs/nfsd/nfsctl.c:892: warning: Function parameter or member 'size' not described in 'write_maxblksize'
      fs/nfsd/nfsctl.c:941: warning: Function parameter or member 'file' not described in 'write_maxconn'
      fs/nfsd/nfsctl.c:941: warning: Function parameter or member 'buf' not described in 'write_maxconn'
      fs/nfsd/nfsctl.c:941: warning: Function parameter or member 'size' not described in 'write_maxconn'
      fs/nfsd/nfsctl.c:1023: warning: Function parameter or member 'file' not described in 'write_leasetime'
      fs/nfsd/nfsctl.c:1023: warning: Function parameter or member 'buf' not described in 'write_leasetime'
      fs/nfsd/nfsctl.c:1023: warning: Function parameter or member 'size' not described in 'write_leasetime'
      fs/nfsd/nfsctl.c:1039: warning: Function parameter or member 'file' not described in 'write_gracetime'
      fs/nfsd/nfsctl.c:1039: warning: Function parameter or member 'buf' not described in 'write_gracetime'
      fs/nfsd/nfsctl.c:1039: warning: Function parameter or member 'size' not described in 'write_gracetime'
      fs/nfsd/nfsctl.c:1094: warning: Function parameter or member 'file' not described in 'write_recoverydir'
      fs/nfsd/nfsctl.c:1094: warning: Function parameter or member 'buf' not described in 'write_recoverydir'
      fs/nfsd/nfsctl.c:1094: warning: Function parameter or member 'size' not described in 'write_recoverydir'
      fs/nfsd/nfsctl.c:1125: warning: Function parameter or member 'file' not described in 'write_v4_end_grace'
      fs/nfsd/nfsctl.c:1125: warning: Function parameter or member 'buf' not described in 'write_v4_end_grace'
      fs/nfsd/nfsctl.c:1125: warning: Function parameter or member 'size' not described in 'write_v4_end_grace'
      
      fs/nfsd/nfs4proc.c:1164: warning: Function parameter or member 'nss' not described in 'nfsd4_interssc_connect'
      fs/nfsd/nfs4proc.c:1164: warning: Function parameter or member 'rqstp' not described in 'nfsd4_interssc_connect'
      fs/nfsd/nfs4proc.c:1164: warning: Function parameter or member 'mount' not described in 'nfsd4_interssc_connect'
      fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'rqstp' not described in 'nfsd4_setup_inter_ssc'
      fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'cstate' not described in 'nfsd4_setup_inter_ssc'
      fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'copy' not described in 'nfsd4_setup_inter_ssc'
      fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'mount' not described in 'nfsd4_setup_inter_ssc'
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      f2453978
    • Chuck Lever's avatar
      NFSD: Squash an annoying compiler warning · 45f56da8
      Chuck Lever authored
      Clean up: Fix gcc empty-body warning when -Wextra is used.
      
      ../fs/nfsd/nfs4state.c:3898:3: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      45f56da8
    • Chuck Lever's avatar
      SUNRPC: Clean up request deferral tracepoints · 8954c5c2
      Chuck Lever authored
      - Rename these so they are easy to enable and search for as a set
      - Move the tracepoints to get a more accurate sense of control flow
      - Tracepoints should not fire on xprt shutdown
      - Display memory address in case data structure had been corrupted
      - Abandon dprintk in these paths
      
      I haven't ever gotten one of these tracepoints to trigger. I wonder
      if we should simply remove them.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      8954c5c2
    • Chuck Lever's avatar
      1eace0d1
    • Chuck Lever's avatar
      NFSD: Add tracepoints to the NFSD state management code · dd5e3fbc
      Chuck Lever authored
      Capture obvious events and replace dprintk() call sites. Introduce
      infrastructure so that adding more tracepoints in this code later
      is simplified.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      dd5e3fbc
    • Chuck Lever's avatar
      NFSD: Add tracepoints to NFSD's duplicate reply cache · 0b175b18
      Chuck Lever authored
      Try to capture DRC failures.
      
      Two additional clean-ups:
      - Introduce Doxygen-style comments for the main entry points
      - Remove a dprintk that fires for an allocation failure. This was
        the only dprintk in the REPCACHE class.
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      [ cel: force typecast for display of checksum values ]
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      0b175b18
    • Chuck Lever's avatar
      SUNRPC: svc_show_status() macro should have enum definitions · d88ff958
      Chuck Lever authored
      Clean up: Add missing TRACE_DEFINE_ENUMs in
      include/trace/events/sunrpc.h
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      d88ff958
    • Chuck Lever's avatar
      SUNRPC: Restructure svc_udp_recvfrom() · fff1ebb2
      Chuck Lever authored
      Clean up. At this point, we are not ready yet to support bio_vecs in
      the UDP transport implementation. However, we can clean up
      svc_udp_recvfrom() to match the tracing and straight-lining recently
      changes made in svc_tcp_recvfrom().
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      fff1ebb2
    • Chuck Lever's avatar
      SUNRPC: Refactor svc_recvfrom() · ca07eda3
      Chuck Lever authored
      This function is not currently "generic" so remove the documenting
      comment and rename it appropriately. Its internals are converted to
      use bio_vecs for reading from the transport socket.
      
      In existing typical sunrpc uses of bio_vecs, the bio_vec array is
      allocated dynamically. Here, instead, an array of bio_vecs is added
      to svc_rqst. The lifetime of this array can be greater than one call
      to xpo_recvfrom():
      
      - Multiple calls to xpo_recvfrom() might be needed to read an RPC
        message completely.
      
      - At some later point, rq_arg.bvecs will point to this array and it
        will carry the received message into svc_process().
      
      I also expect that a future optimization will remove either the
      rq_vec or rq_pages array in favor of rq_bvec, thus conserving the
      size of struct svc_rqst.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      ca07eda3
    • Chuck Lever's avatar
      SUNRPC: Clean up svc_release_skb() functions · cca557a5
      Chuck Lever authored
      Rename these functions using the convention used for other xpo
      method entry points.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      cca557a5
    • Chuck Lever's avatar
      SUNRPC: Refactor recvfrom path dealing with incomplete TCP receives · 6be8c594
      Chuck Lever authored
      Clean up: move exception processing out of the main path.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      6be8c594
    • Chuck Lever's avatar
  6. 18 May, 2020 20 commits