1. 10 5月, 2017 1 次提交
  2. 13 4月, 2017 1 次提交
    • O
      nfsd: fix oops on unsupported operation · 05b7278d
      Olga Kornievskaia 提交于
      I'm hitting the BUG in nfsd4_max_reply() at fs/nfsd/nfs4proc.c:2495 when
      client sends an operation the server doesn't support.
      
      in nfsd4_max_reply() it checks for NULL rsize_bop but a non-supported
      operation wouldn't have that set.
      
      Cc: Kinglong Mee <kinglongmee@gmail.com>
      Fixes: 2282cd2c "NFSD: Get response size before operation..."
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      05b7278d
  3. 25 2月, 2017 2 次提交
  4. 18 2月, 2017 1 次提交
  5. 01 2月, 2017 2 次提交
    • J
      nfsd: opt in to labeled nfs per export · 32ddd944
      J. Bruce Fields 提交于
      Currently turning on NFSv4.2 results in 4.2 clients suddenly seeing the
      individual file labels as they're set on the server.  This is not what
      they've previously seen, and not appropriate in may cases.  (In
      particular, if clients have heterogenous security policies then one
      client's labels may not even make sense to another.)  Labeled NFS should
      be opted in only in those cases when the administrator knows it makes
      sense.
      
      It's helpful to be able to turn 4.2 on by default, and otherwise the
      protocol upgrade seems free of regressions.  So, default labeled NFS to
      off and provide an export flag to reenable it.
      
      Users wanting labeled NFS support on an export will henceforth need to:
      
      	- make sure 4.2 support is enabled on client and server (as
      	  before), and
      	- upgrade the server nfs-utils to a version supporting the new
      	  "security_label" export flag.
      	- set that "security_label" flag on the export.
      
      This is commit may be seen as a regression to anyone currently depending
      on security labels.  We believe those cases are currently rare.
      
      Reported-by: tibbs@math.uh.edu
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      32ddd944
    • K
      NFSD: pass an integer for stable type to nfsd_vfs_write · 54bbb7d2
      Kinglong Mee 提交于
      After fae5096a "nfsd: assume writeable exportabled filesystems have
      f_sync" we no longer modify this argument.
      
      This is just cleanup, no change in functionality.
      Signed-off-by: NKinglong Mee <kinglongmee@gmail.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      54bbb7d2
  6. 16 12月, 2016 1 次提交
  7. 02 11月, 2016 1 次提交
  8. 08 10月, 2016 1 次提交
  9. 05 8月, 2016 2 次提交
  10. 16 7月, 2016 1 次提交
  11. 14 7月, 2016 2 次提交
  12. 18 3月, 2016 1 次提交
    • C
      nfsd: add SCSI layout support · f99d4fbd
      Christoph Hellwig 提交于
      This is a simple extension to the block layout driver to use SCSI
      persistent reservations for access control and fencing, as well as
      SCSI VPD pages for device identification.
      
      For this we need to pass the nfs4_client to the proc_getdeviceinfo method
      to generate the reservation key, and add a new fence_client method
      to allow for fence actions in the layout driver.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      f99d4fbd
  13. 16 3月, 2016 1 次提交
    • J
      nfsd: fix deadlock secinfo+readdir compound · 2f6fc056
      J. Bruce Fields 提交于
      nfsd_lookup_dentry exits with the parent filehandle locked.  fh_put also
      unlocks if necessary (nfsd filehandle locking is probably too lenient),
      so it gets unlocked eventually, but if the following op in the compound
      needs to lock it again, we can deadlock.
      
      A fuzzer ran into this; normal clients don't send a secinfo followed by
      a readdir in the same compound.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      2f6fc056
  14. 03 3月, 2016 1 次提交
  15. 23 1月, 2016 1 次提交
    • A
      wrappers for ->i_mutex access · 5955102c
      Al Viro 提交于
      parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
      inode_foo(inode) being mutex_foo(&inode->i_mutex).
      
      Please, use those for access to ->i_mutex; over the coming cycle
      ->i_mutex will become rwsem, with ->lookup() done with it held
      only shared.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5955102c
  16. 08 12月, 2015 2 次提交
  17. 24 10月, 2015 1 次提交
    • J
      nfsd: serialize layout stateid morphing operations · cc8a5532
      Jeff Layton 提交于
      In order to allow the client to make a sane determination of what
      happened with racing LAYOUTGET/LAYOUTRETURN/CB_LAYOUTRECALL calls, we
      must ensure that the seqids return accurately represent the order of
      operations. The simplest way to do that is to ensure that operations on
      a single stateid are serialized.
      
      This patch adds a mutex to the layout stateid, and locks it when
      checking the layout stateid's seqid. The mutex is held over the entire
      operation and released after the seqid is bumped.
      
      Note that in the case of CB_LAYOUTRECALL we must move the increment of
      the seqid and setting into a new cb "prepare" operation. The lease
      infrastructure will call the lm_break callback with a spinlock held, so
      and we can't take the mutex in that codepath.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      cc8a5532
  18. 01 9月, 2015 1 次提交
  19. 13 8月, 2015 1 次提交
  20. 11 8月, 2015 1 次提交
  21. 21 7月, 2015 1 次提交
  22. 23 6月, 2015 2 次提交
  23. 22 4月, 2015 2 次提交
  24. 16 4月, 2015 1 次提交
  25. 01 4月, 2015 3 次提交
  26. 21 3月, 2015 1 次提交
  27. 03 2月, 2015 3 次提交
    • C
      nfsd: add trace events · 31ef83dc
      Christoph Hellwig 提交于
      For now just a few simple events to trace the layout stateid lifetime, but
      these already were enough to find several bugs in the Linux client layout
      stateid handling.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      31ef83dc
    • C
      nfsd: implement pNFS layout recalls · c5c707f9
      Christoph Hellwig 提交于
      Add support to issue layout recalls to clients.  For now we only support
      full-file recalls to get a simple and stable implementation.  This allows
      to embedd a nfsd4_callback structure in the layout_state and thus avoid
      any memory allocations under spinlocks during a recall.  For normal
      use cases that do not intent to share a single file between multiple
      clients this implementation is fully sufficient.
      
      To ensure layouts are recalled on local filesystem access each layout
      state registers a new FL_LAYOUT lease with the kernel file locking code,
      which filesystems that support pNFS exports that require recalls need
      to break on conflicting access patterns.
      
      The XDR code is based on the old pNFS server implementation by
      Andy Adamson, Benny Halevy, Boaz Harrosh, Dean Hildebrand, Fred Isaman,
      Marc Eshel, Mike Sager and Ricardo Labiaga.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      c5c707f9
    • C
      nfsd: implement pNFS operations · 9cf514cc
      Christoph Hellwig 提交于
      Add support for the GETDEVICEINFO, LAYOUTGET, LAYOUTCOMMIT and
      LAYOUTRETURN NFSv4.1 operations, as well as backing code to manage
      outstanding layouts and devices.
      
      Layout management is very straight forward, with a nfs4_layout_stateid
      structure that extends nfs4_stid to manage layout stateids as the
      top-level structure.  It is linked into the nfs4_file and nfs4_client
      structures like the other stateids, and contains a linked list of
      layouts that hang of the stateid.  The actual layout operations are
      implemented in layout drivers that are not part of this commit, but
      will be added later.
      
      The worst part of this commit is the management of the pNFS device IDs,
      which suffers from a specification that is not sanely implementable due
      to the fact that the device-IDs are global and not bound to an export,
      and have a small enough size so that we can't store the fsid portion of
      a file handle, and must never be reused.  As we still do need perform all
      export authentication and validation checks on a device ID passed to
      GETDEVICEINFO we are caught between a rock and a hard place.  To work
      around this issue we add a new hash that maps from a 64-bit integer to a
      fsid so that we can look up the export to authenticate against it,
      a 32-bit integer as a generation that we can bump when changing the device,
      and a currently unused 32-bit integer that could be used in the future
      to handle more than a single device per export.  Entries in this hash
      table are never deleted as we can't reuse the ids anyway, and would have
      a severe lifetime problem anyway as Linux export structures are temporary
      structures that can go away under load.
      
      Parts of the XDR data, structures and marshaling/unmarshaling code, as
      well as many concepts are derived from the old pNFS server implementation
      from Andy Adamson, Benny Halevy, Dean Hildebrand, Marc Eshel, Fred Isaman,
      Mike Sager, Ricardo Labiaga and many others.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      9cf514cc
  28. 10 12月, 2014 2 次提交