1. 20 Oct, 2020 1 commit
  2. 16 Oct, 2020 3 commits
  3. 12 Oct, 2020 5 commits
  4. 02 Oct, 2020 13 commits
  5. 25 Sep, 2020 18 commits
    • J. Bruce Fields's avatar
      nfsd: rq_lease_breaker cleanup · 13956160
      J. Bruce Fields authored
      Since only the v4 code cares about it, maybe it's better to leave
      rq_lease_breaker out of the common dispatch code?
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      13956160
    • J. Bruce Fields's avatar
      nfsd4: remove check_conflicting_opens warning · 50747dd5
      J. Bruce Fields authored
      There are actually rare races where this is possible (e.g. if a new open
      intervenes between the read of i_writecount and the fi_fds).
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      50747dd5
    • J. Bruce Fields's avatar
      nfsd: Cache R, RW, and W opens separately · ae3c57b5
      J. Bruce Fields authored
      The nfsd open code has always kept separate read-only, read-write, and
      write-only opens as necessary to ensure that when a client closes or
      downgrades, we don't retain more access than necessary.
      
      Also, I didn't realize the cache behaved this way when I wrote
      94415b06 "nfsd4: a client's own opens needn't prevent delegations".
      There I assumed fi_fds[O_WRONLY] and fi_fds[O_RDWR] would always be
      distinct.  The violation of that assumption is triggering a
      WARN_ON_ONCE() and could also cause the server to give out a delegation
      when it shouldn't.
      
      Fixes: 94415b06 ("nfsd4: a client's own opens needn't prevent delegations")
      Tested-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      ae3c57b5
    • J. Bruce Fields's avatar
      sunrpc: simplify do_cache_clean · 0aa99c4d
      J. Bruce Fields authored
      Is it just me, or is the logic written in a slightly convoluted way?
      
      I find it a little easier to read this way.
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      0aa99c4d
    • Xu Wang's avatar
      sunrpc: cache : Replace seq_printf with seq_puts · 9dbc1f45
      Xu Wang authored
      seq_puts is a lot cheaper than seq_printf, so use that to print
      literal strings.
      Signed-off-by: default avatarXu Wang <vulab@iscas.ac.cn>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      9dbc1f45
    • Rik van Riel's avatar
      silence nfscache allocation warnings with kvzalloc · 8c38b705
      Rik van Riel authored
      silence nfscache allocation warnings with kvzalloc
      
      Currently nfsd_reply_cache_init attempts hash table allocation through
      kmalloc, and manually falls back to vzalloc if that fails. This makes
      the code a little larger than needed, and creates a significant amount
      of serial console spam if you have enough systems.
      
      Switching to kvzalloc gets rid of the allocation warnings, and makes
      the code a little cleaner too as a side effect.
      
      Freeing of nn->drc_hashtbl is already done using kvfree currently.
      Signed-off-by: default avatarRik van Riel <riel@surriel.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      8c38b705
    • Zheng Bin's avatar
      nfsd: fix comparison to bool warning · 44b49aa6
      Zheng Bin authored
      Fixes coccicheck warning:
      
      fs/nfsd/nfs4proc.c:3234:5-29: WARNING: Comparison to bool
      Signed-off-by: default avatarZheng Bin <zhengbin13@huawei.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      44b49aa6
    • Chuck Lever's avatar
      NFSD: Correct type annotations in COPY XDR functions · 5aff7d08
      Chuck Lever authored
      Squelch some sparse warnings:
      
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:1860:16: warning: incorrect type in assignment (different base types)
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:1860:16:    expected int status
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:1860:16:    got restricted __be32
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:1862:24: warning: incorrect type in return expression (different base types)
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:1862:24:    expected restricted __be32
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:1862:24:    got int status
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      5aff7d08
    • Chuck Lever's avatar
      NFSD: Correct type annotations in user xattr XDR functions · b9a49237
      Chuck Lever authored
      Squelch some sparse warnings:
      
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4692:24: warning: incorrect type in return expression (different base types)
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4692:24:    expected int
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4692:24:    got restricted __be32 [usertype]
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4702:32: warning: incorrect type in return expression (different base types)
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4702:32:    expected int
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4702:32:    got restricted __be32 [usertype]
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4739:13: warning: incorrect type in assignment (different base types)
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4739:13:    expected restricted __be32 [usertype] err
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4739:13:    got int
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4891:15: warning: incorrect type in assignment (different base types)
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4891:15:    expected unsigned int [assigned] [usertype] count
      /home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4891:15:    got restricted __be32 [usertype]
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      b9a49237
    • Chuck Lever's avatar
      NFSD: Correct type annotations in user xattr helpers · 8237284a
      Chuck Lever authored
      Squelch some sparse warnings:
      
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2264:13: warning: incorrect type in assignment (different base types)
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2264:13:    expected int err
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2264:13:    got restricted __be32
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2266:24: warning: incorrect type in return expression (different base types)
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2266:24:    expected restricted __be32
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2266:24:    got int err
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2288:13: warning: incorrect type in assignment (different base types)
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2288:13:    expected int err
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2288:13:    got restricted __be32
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2290:24: warning: incorrect type in return expression (different base types)
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2290:24:    expected restricted __be32
      /home/cel/src/linux/linux/fs/nfsd/vfs.c:2290:24:    got int err
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      8237284a
    • Anna Schumaker's avatar
      SUNRPC/NFSD: Implement xdr_reserve_space_vec() · 403217f3
      Anna Schumaker authored
      Reserving space for a large READ payload requires special handling when
      reserving space in the xdr buffer pages. One problem we can have is use
      of the scratch buffer, which is used to get a pointer to a contiguous
      region of data up to PAGE_SIZE. When using the scratch buffer, calls to
      xdr_commit_encode() shift the data to it's proper alignment in the xdr
      buffer. If we've reserved several pages in a vector, then this could
      potentially invalidate earlier pointers and result in incorrect READ
      data being sent to the client.
      
      I get around this by looking at the amount of space left in the current
      page, and never reserve more than that for each entry in the read
      vector. This lets us place data directly where it needs to go in the
      buffer pages.
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      403217f3
    • Hou Tao's avatar
      nfsd: rename delegation related tracepoints to make them less confusing · 3caf9175
      Hou Tao authored
      Now when a read delegation is given, two delegation related traces
      will be printed:
      
          nfsd_deleg_open: client 5f45b854:e6058001 stateid 00000030:00000001
          nfsd_deleg_none: client 5f45b854:e6058001 stateid 0000002f:00000001
      
      Although the intention is to let developers know two stateid are
      returned, the traces are confusing about whether or not a read delegation
      is handled out. So renaming trace_nfsd_deleg_none() to trace_nfsd_open()
      and trace_nfsd_deleg_open() to trace_nfsd_deleg_read() to make
      the intension clearer.
      
      The patched traces will be:
      
          nfsd_deleg_read: client 5f48a967:b55b21cd stateid 00000003:00000001
          nfsd_open: client 5f48a967:b55b21cd stateid 00000002:00000001
      Suggested-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      3caf9175
    • J. Bruce Fields's avatar
      Documentation: update RPCSEC_GSSv3 RFC link · ade3dbad
      J. Bruce Fields authored
      This draft is an official RFC now.
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      ade3dbad
    • J. Bruce Fields's avatar
      MAINTAINERS: Note NFS docs under Documentation/ · ff7e11f3
      J. Bruce Fields authored
      It struck me while watching Jon Corbet ask how to keep kernel
      Documentation up to date, that it might help if we were actually cc'd on
      Documentation/filesystems/nfs/ changes.
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      ff7e11f3
    • Alex Dewar's avatar
      nfsd: Remove unnecessary assignment in nfs4xdr.c · e2a1840e
      Alex Dewar authored
      In nfsd4_encode_listxattrs(), the variable p is assigned to at one point
      but this value is never used before p is reassigned. Fix this.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarAlex Dewar <alex.dewar90@gmail.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      e2a1840e
    • Randy Dunlap's avatar
      net: sunrpc: delete repeated words · 1cc5213b
      Randy Dunlap authored
      Drop duplicate words in net/sunrpc/.
      Also fix "Anyone" to be "Any one".
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Chuck Lever <chuck.lever@oracle.com>
      Cc: linux-nfs@vger.kernel.org
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      1cc5213b
    • Alex Dewar's avatar
      nfsd: Fix typo in comment · 4cce11fa
      Alex Dewar authored
      Missing "is".
      Signed-off-by: default avatarAlex Dewar <alex.dewar90@gmail.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      4cce11fa
    • J. Bruce Fields's avatar
      nfsd: give up callbacks on revoked delegations · 12ed22f3
      J. Bruce Fields authored
      The delegation is no longer returnable, so I don't think there's much
      point retrying the recall.
      
      (I think it's worth asking why we even need separate CLOSED_DELEG and
      REVOKED_DELEG states.  But treating them the same would currently cause
      nfsd4_free_stateid to call list_del_init(&dp->dl_recall_lru) on a
      delegation that the laundromat had unhashed but not revoked, incorrectly
      removing it from the laundromat's reaplist or a client's dl_recall_lru.)
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      12ed22f3