1. 18 10月, 2011 3 次提交
    • J
      nfsd4: preallocate open stateid in process_open1() · 4cdc951b
      J. Bruce Fields 提交于
      As with the nfs4_file, we'd prefer to find out about any failure before
      creating a new file rather than after.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      4cdc951b
    • J
      nfsd4: preallocate nfs4_file in process_open1() · 32513b40
      J. Bruce Fields 提交于
      Creating a new file is an irrevocable step--once it's visible in the
      filesystem, other processes may have seen it and done something with it,
      and unlinking it wouldn't simply undo the effects of the create.
      
      Therefore, in the case where OPEN creates a new file, we shouldn't do
      the create until we know that the rest of the OPEN processing will
      succeed.
      
      For example, we should preallocate a struct file in case we need it
      until waiting to allocate it till process_open2(), which is already too
      late.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      32513b40
    • J
      nfsd4: clean up open owners on OPEN failure · d29b20cd
      J. Bruce Fields 提交于
      If process_open1() creates a new open owner, but the open later fails,
      the current code will leave the open owner around.  It won't be on the
      close_lru list, and the client isn't expected to send a CLOSE, so it
      will hang around as long as the client does.
      
      Similarly, if process_open1() removes an existing open owner from the
      close lru, anticipating that an open owner that previously had no
      associated stateid's now will, but the open subsequently fails, then
      we'll again be left with the same leak.
      
      Fix both problems.
      Reported-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      d29b20cd
  2. 12 10月, 2011 1 次提交
  3. 27 9月, 2011 1 次提交
  4. 16 9月, 2011 1 次提交
    • M
      nfsd41: try to check reply size before operation · 58e7b33a
      Mi Jinlong 提交于
      For checking the size of reply before calling a operation,
      we need try to get maxsize of the operation's reply.
      
      v3: using new method as Bruce said,
      
       "we could handle operations in two different ways:
      
      	- For operations that actually change something (write, rename,
      	  open, close, ...), do it the way we're doing it now: be
      	  very careful to estimate the size of the response before even
      	  processing the operation.
      	- For operations that don't change anything (read, getattr, ...)
      	  just go ahead and do the operation.  If you realize after the
      	  fact that the response is too large, then return the error at
      	  that point.
      
        So we'd add another flag to op_flags: say, OP_MODIFIES_SOMETHING.  And for
        operations with OP_MODIFIES_SOMETHING set, we'd do the first thing.  For
        operations without it set, we'd do the second."
      Signed-off-by: NMi Jinlong <mijinlong@cn.fujitsu.com>
      [bfields@redhat.com: crash, don't attempt to handle, undefined op_rsize_bop]
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      58e7b33a
  5. 07 9月, 2011 1 次提交
  6. 01 9月, 2011 3 次提交
  7. 28 8月, 2011 1 次提交
  8. 18 7月, 2011 2 次提交
  9. 16 7月, 2011 2 次提交
  10. 12 1月, 2011 2 次提交
  11. 18 12月, 2010 1 次提交
  12. 09 12月, 2010 1 次提交
    • N
      nfsd: Fix possible BUG_ON firing in set_change_info · c1ac3ffc
      Neil Brown 提交于
      If vfs_getattr in fill_post_wcc returns an error, we don't
      set fh_post_change.
      For NFSv4, this can result in set_change_info triggering a BUG_ON.
      i.e. fh_post_saved being zero isn't really a bug.
      
      So:
       - instead of BUGging when fh_post_saved is zero, just clear ->atomic.
       - if vfs_getattr fails in fill_post_wcc, take a copy of i_ctime anyway.
         This will be used i seg_change_info, but not overly trusted.
       - While we are there, remove the pointless 'if' statements in set_change_info.
         There is no harm setting all the values.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Cc: stable@kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      c1ac3ffc
  13. 14 5月, 2010 1 次提交
  14. 20 4月, 2010 1 次提交
  15. 16 12月, 2009 1 次提交
  16. 15 12月, 2009 2 次提交
    • B
      nfsd: Move private headers to source directory · 9a74af21
      Boaz Harrosh 提交于
      Lots of include/linux/nfsd/* headers are only used by
      nfsd module. Move them to the source directory
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      9a74af21
    • B
      nfsd: Headers Independence and include cleanups · 72579ac9
      Boaz Harrosh 提交于
      * Add includes that are directly used by headers
      * Remove includes that are not needed
      
      These are the changes made:
      
      [xdr.h]
      struct nfsd_readdirres has an embedded struct readdir_cd from nfsd.h
      fixing that we can drop other includes
      
      [xdr4.h]
      embedded types defined both at state.h and nfsd.h
      
      [syscall.h]
      After export.h fix none of these stuff is needed.
      fix extra space in # include <> statement
      
      [stats.h]
      does not need <linux/nfs4.h> but was export to user-mode
      so I don't touch it
      
      [state.h]
      embedded types from nfsfh.h like struct knfsd_fh. bringing that
      eliminates the need for all other includes
      
      [nfsfh.h]
      directly manipulating types from sunrpc/svc.h.
      Removed Other unused headers.
      
      [nfsd.h]
      removed unused headers include
      
      [export.h]
      lots of sunrpc/svc.h types and a single prototype declaration
      with pointer from nfsfh.h, but all users of export.h do need
      nfsfh.h any way. remove now un-needed include.
      
      [const.h]
      Unfixed (not independent)
      
      [cache.h]
      could do with a forward declaration of "struct svc_rqst;"
      from sunrpc/svc.h but all users absolutely will need
      sunrpc/svc.h it is easier overall this way.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      72579ac9
  17. 02 9月, 2009 1 次提交
    • A
      nfsd41: replace page based DRC with buffer based DRC · 557ce264
      Andy Adamson 提交于
      Use NFSD_SLOT_CACHE_SIZE size buffers for sessions DRC instead of holding nfsd
      pages in cache.
      
      Connectathon testing has shown that 1024 bytes for encoded compound operation
      responses past the sequence operation is sufficient, 512 bytes is a little too
      small. Set NFSD_SLOT_CACHE_SIZE to 1024.
      
      Allocate memory for the session DRC in the CREATE_SESSION operation
      to guarantee that the memory resource is available for caching responses.
      Allocate each slot individually in preparation for slot table size negotiation.
      
      Remove struct nfsd4_cache_entry and helper functions for the old page-based
      DRC.
      
      The iov_len calculation in nfs4svc_encode_compoundres is now always
      correct.  Replay is now done in nfsd4_sequence under the state lock, so
      the session ref count is only bumped on non-replay. Clean up the
      nfs4svc_encode_compoundres session logic.
      
      The nfsd4_compound_state statp pointer is also not used.
      Remove nfsd4_set_statp().
      
      Move useful nfsd4_cache_entry fields into nfsd4_slot.
      
      Signed-off-by: Andy Adamson <andros@netapp.com
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      557ce264
  18. 29 8月, 2009 1 次提交
    • A
      nfsd41: expand solo sequence check · 468de9e5
      Andy Adamson 提交于
      Compounds consisting of only a sequence operation don't need any
      additional caching beyond the sequence information we store in the slot
      entry.  Fix nfsd4_is_solo_sequence to identify this case correctly.
      
      The additional check for a failed sequence in nfsd4_store_cache_entry()
      is redundant, since the nfsd4_is_solo_sequence call lower down catches
      this case.
      
      The final ce_cachethis set in nfsd4_sequence is also redundant.
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      468de9e5
  19. 29 7月, 2009 1 次提交
    • A
      nfsd41: Use separate DRC for setclientid · 49557cc7
      Andy Adamson 提交于
      Instead of trying to share the generic 4.1 reply cache code for the
      CREATE_SESSION reply cache, it's simpler to handle CREATE_SESSION
      separately.
      
      The nfs41 single slot clientid DRC holds the results of create session
      processing.  CREATE_SESSION can be preceeded by a SEQUENCE operation
      (an embedded CREATE_SESSION) and the create session single slot cache must be
      maintained.  nfsd4_replay_cache_entry() and nfsd4_store_cache_entry() do not
      implement the replay of an embedded CREATE_SESSION.
      
      The clientid DRC slot does not need the inuse, cachethis or other fields that
      the multiple slot session cache uses.  Replace the clientid DRC cache struct
      nfs4_slot cache with a new nfsd4_clid_slot cache.  Save the xdr struct
      nfsd4_create_session into the cache at the end of processing, and on a replay,
      replace the struct for the replay request with the cached version all while
      under the state lock.
      
      nfsd4_proc_compound will handle both the solo and embedded CREATE_SESSION case
      via the normal use of encode_operation.
      
      Errors that do not change the create session cache:
      A create session NFS4ERR_STALE_CLIENTID error means that a client record
      (and associated create session slot) could not be found and therefore can't
      be changed.  NFSERR_SEQ_MISORDERED errors do not change the slot cache.
      
      All other errors get cached.
      
      Remove the clientid DRC specific check in nfs4svc_encode_compoundres to
      put the session only if cstate.session is set which will now always be true.
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      49557cc7
  20. 17 6月, 2009 1 次提交
  21. 29 4月, 2009 1 次提交
    • J
      nfsd: support ext4 i_version · c654b8a9
      J. Bruce Fields 提交于
      ext4 supports a real NFSv4 change attribute, which is bumped whenever
      the ctime would be updated, including times when two updates arrive
      within a jiffy of each other.  (Note that although ext4 has space for
      nanosecond-precision ctime, the real resolution is lower: it actually
      uses jiffies as the time-source.)  This ensures clients will invalidate
      their caches when they need to.
      
      There is some fear that keeping the i_version up-to-date could have
      performance drawbacks, so for now it's turned on only by a mount option.
      We hope to do something better eventually.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Cc: Theodore Tso <tytso@mit.edu>
      c654b8a9
  22. 04 4月, 2009 11 次提交