1. 10 12月, 2019 5 次提交
  2. 08 12月, 2019 1 次提交
  3. 01 12月, 2019 1 次提交
  4. 10 9月, 2019 1 次提交
  5. 19 8月, 2019 1 次提交
  6. 24 4月, 2019 1 次提交
  7. 09 4月, 2019 1 次提交
    • G
      fs: mark expected switch fall-throughs · 0a4c9265
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      This patch fixes the following warnings:
      
      fs/affs/affs.h:124:38: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/configfs/dir.c:1692:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/configfs/dir.c:1694:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ceph/file.c:249:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ext4/hash.c:233:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ext4/hash.c:246:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ext2/inode.c:1237:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ext2/inode.c:1244:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ext4/indirect.c:1182:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ext4/indirect.c:1188:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ext4/indirect.c:1432:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ext4/indirect.c:1440:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/f2fs/node.c:618:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/f2fs/node.c:620:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/btrfs/ref-verify.c:522:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/gfs2/bmap.c:711:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/gfs2/bmap.c:722:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/jffs2/fs.c:339:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/nfsd/nfs4proc.c:429:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ufs/util.h:62:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/ufs/util.h:43:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/fcntl.c:770:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/seq_file.c:319:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/libfs.c:148:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/libfs.c:150:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/signalfd.c:178:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
      fs/locks.c:1473:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enabling
      -Wimplicit-fallthrough.
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      0a4c9265
  8. 15 12月, 2018 1 次提交
  9. 28 11月, 2018 3 次提交
  10. 09 11月, 2018 1 次提交
  11. 26 9月, 2018 3 次提交
    • O
      NFSD introduce async copy feature · e0639dc5
      Olga Kornievskaia 提交于
      Upon receiving a request for async copy, create a new kthread.  If we
      get asynchronous request, make sure to copy the needed arguments/state
      from the stack before starting the copy. Then start the thread and reply
      back to the client indicating copy is asynchronous.
      
      nfsd_copy_file_range() will copy in a loop over the total number of
      bytes is needed to copy. In case a failure happens in the middle, we
      ignore the error and return how much we copied so far. Once done
      creating a workitem for the callback workqueue and send CB_OFFLOAD with
      the results.
      
      The lifetime of the copy stateid is bound to the vfs copy. This way we
      don't need to keep the nfsd_net structure for the callback.  We could
      keep it around longer so that an OFFLOAD_STATUS that came late would
      still get results, but clients should be able to deal without that.
      
      We handle OFFLOAD_CANCEL by sending a signal to the copy thread and
      calling kthread_stop.
      
      A client should cancel any ongoing copies before calling DESTROY_CLIENT;
      if not, we return a CLIENT_BUSY error.
      
      If the client is destroyed for some other reason (lease expiration, or
      server shutdown), we must clean up any ongoing copies ourselves.
      Signed-off-by: NOlga Kornievskaia <kolga@netapp.com>
      [colin.king@canonical.com: fix leak in error case]
      [bfields@fieldses.org: remove signalling, merge patches]
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      e0639dc5
    • O
      NFSD OFFLOAD_CANCEL xdr · 885e2bf3
      Olga Kornievskaia 提交于
      Signed-off-by: NOlga Kornievskaia <kolga@netapp.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      885e2bf3
    • O
      NFSD OFFLOAD_STATUS xdr · 6308bc98
      Olga Kornievskaia 提交于
      Signed-off-by: NOlga Kornievskaia <kolga@netapp.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      6308bc98
  12. 10 8月, 2018 1 次提交
    • C
      NFSD: Refactor the generic write vector fill helper · 3fd9557a
      Chuck Lever 提交于
      fill_in_write_vector() is nearly the same logic as
      svc_fill_write_vector(), but there are a few differences so that
      the former can handle multiple WRITE payloads in a single COMPOUND.
      
      svc_fill_write_vector() can be adjusted so that it can be used in
      the NFSv4 WRITE code path too. Instead of assuming the pages are
      coming from rq_args.pages, have the caller pass in the page list.
      
      The immediate benefit is a reduction of code duplication. It also
      prevents the NFSv4 WRITE decoder from passing an empty vector
      element when the transport has provided the payload in the xdr_buf's
      page array.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      3fd9557a
  13. 17 6月, 2018 3 次提交
  14. 04 4月, 2018 5 次提交
    • J
      nfsd: fix incorrect umasks · 880a3a53
      J. Bruce Fields 提交于
      We're neglecting to clear the umask after it's set, which can cause a
      later unrelated rpc to (incorrectly) use the same umask if it happens to
      be processed by the same thread.
      
      There's a more subtle problem here too:
      
      An NFSv4 compound request is decoded all in one pass before any
      operations are executed.
      
      Currently we're setting current->fs->umask at the time we decode the
      compound.  In theory a single compound could contain multiple creates
      each setting a umask.  In that case we'd end up using whichever umask
      was passed in the *last* operation as the umask for all the creates,
      whether that was correct or not.
      
      So, we should just be saving the umask at decode time and waiting to set
      it until we actually process the corresponding operation.
      
      In practice it's unlikely any client would do multiple creates in a
      single compound.  And even if it did they'd likely be from the same
      process (hence carry the same umask).  So this is a little academic, but
      we should get it right anyway.
      
      Fixes: 47057abd (nfsd: add support for the umask attribute)
      Cc: stable@vger.kernel.org
      Reported-by: NLucash Stach <l.stach@pengutronix.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      880a3a53
    • C
      nfsd: Trace NFSv4 COMPOUND execution · fff4080b
      Chuck Lever 提交于
      This helps record the identity and timing of the ops in each NFSv4
      COMPOUND, replacing dprintk calls that did much the same thing.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      fff4080b
    • C
      nfsd: Add I/O trace points in the NFSv4 read proc · 87c5942e
      Chuck Lever 提交于
      NFSv4 read compound processing invokes nfsd_splice_read and
      nfs_readv directly, so the trace points currently in nfsd_read are
      not invoked for NFSv4 reads.
      
      Move the NFSD READ trace points to common helpers so that NFSv4
      reads are captured.
      
      Also, record any local I/O error that occurs, the total count of
      bytes that were actually returned, and whether splice or vectored
      read was used.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      87c5942e
    • C
      nfsd: Add I/O trace points in the NFSv4 write path · d890be15
      Chuck Lever 提交于
      NFSv4 write compound processing invokes nfsd_vfs_write directly. The
      trace points currently in nfsd_write are not effective for NFSv4
      writes.
      
      Move the trace points into the shared nfsd_vfs_write() helper.
      
      After the I/O, we also want to record any local I/O error that
      might have occurred, and the total count of bytes that were actually
      moved (rather than the requested number).
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      d890be15
    • C
      nfsd: Add "nfsd_" to trace point names · f394b62b
      Chuck Lever 提交于
      Follow naming convention used in client and in sunrpc layers.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      f394b62b
  15. 20 3月, 2018 1 次提交
  16. 09 2月, 2018 1 次提交
    • J
      nfsd: return RESOURCE not GARBAGE_ARGS on too many ops · 0078117c
      J. Bruce Fields 提交于
      A client that sends more than a hundred ops in a single compound
      currently gets an rpc-level GARBAGE_ARGS error.
      
      It would be more helpful to return NFS4ERR_RESOURCE, since that gives
      the client a better idea how to recover (for example by splitting up the
      compound into smaller compounds).
      
      This is all a bit academic since we've never actually seen a reason for
      clients to send such long compounds, but we may as well fix it.
      
      While we're there, just use NFSD4_MAX_OPS_PER_COMPOUND == 16, the
      constant we already use in the 4.1 case, instead of hard-coding 100.
      Chances anyone actually uses even 16 ops per compound are small enough
      that I think there's a neglible risk or any regression.
      
      This fixes pynfs test COMP6.
      Reported-by: N"Lu, Xinyu" <luxy.fnst@cn.fujitsu.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      0078117c
  17. 22 12月, 2017 1 次提交
  18. 08 11月, 2017 1 次提交
    • A
      nfds: avoid gettimeofday for nfssvc_boot time · 256a89fa
      Arnd Bergmann 提交于
      do_gettimeofday() is deprecated and we should generally use time64_t
      based functions instead.
      
      In case of nfsd, all three users of nfssvc_boot only use the initial
      time as a unique token, and are not affected by it overflowing, so they
      are not affected by the y2038 overflow.
      
      This converts the structure to timespec64 anyway and adds comments
      to all uses, to document that we have thought about it and avoid
      having to look at it again.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      256a89fa
  19. 06 10月, 2017 1 次提交
    • E
      nfsd4: define nfsd4_secinfo_no_name_release() · ec572b9e
      Eryu Guan 提交于
      Commit 34b1744c ("nfsd4: define ->op_release for compound ops")
      defined a couple ->op_release functions and run them if necessary.
      
      But there's a problem with that is that it reused
      nfsd4_secinfo_release() as the op_release of OP_SECINFO_NO_NAME, and
      caused a leak on struct nfsd4_secinfo_no_name in
      nfsd4_encode_secinfo_no_name(), because there's no .si_exp field in
      struct nfsd4_secinfo_no_name.
      
      I found this because I was unable to umount an ext4 partition after
      exporting it via NFS & run fsstress on the nfs mount. A simplified
      reproducer would be:
      
       # mount a local-fs device at /mnt/test, and export it via NFS with
       # fsid=0 export option (this is required)
       mount /dev/sda5 /mnt/test
       echo "/mnt/test *(rw,no_root_squash,fsid=0)" >> /etc/exports
       service nfs restart
      
       # locally mount the nfs export with all default, note that I have
       # nfsv4.1 configured as the default nfs version, because of the
       # fsid export option, v4 mount would fail and fall back to v3
       mount localhost:/mnt/test /mnt/nfs
      
       # try to umount the underlying device, but got EBUSY
       umount /mnt/nfs
       service nfs stop
       umount /mnt/test <=== EBUSY here
      
      Fixed it by defining a separate nfsd4_secinfo_no_name_release()
      function as the op_release method of OP_SECINFO_NO_NAME that
      releases the correct nfsd4_secinfo_no_name structure.
      
      Fixes: 34b1744c ("nfsd4: define ->op_release for compound ops")
      Signed-off-by: NEryu Guan <eguan@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      ec572b9e
  20. 05 10月, 2017 1 次提交
  21. 25 8月, 2017 3 次提交
  22. 02 8月, 2017 1 次提交
  23. 14 7月, 2017 2 次提交