1. 04 4月, 2009 3 次提交
    • B
      nfsd41: sequence operation · b85d4c01
      Benny Halevy 提交于
      Implement the sequence operation conforming to
      http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26
      
      Check for stale clientid (as derived from the sessionid).
      Enforce slotid range and exactly-once semantics using
      the slotid and seqid.
      
      If everything went well renew the client lease and
      mark the slot INPROGRESS.
      
      Add a struct nfsd4_slot pointer to struct nfsd4_compound_state.
      To be used for sessions DRC replay.
      
      [nfsd41: rename sequence catchthis to cachethis]
      Signed-off-by: Andy Adamson<andros@netapp.com>
      [pulled some code to set cstate->slot from "nfsd DRC logic"]
      [use sessionid_lock spin lock]
      [nfsd41: use bool inuse for slot state]
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfsd: add a struct nfsd4_slot pointer to struct nfsd4_compound_state]
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfsd41: add nfsd4_session pointer to nfsd4_compound_state]
      [nfsd41: set cstate session]
      [nfsd41: use cstate session in nfsd4_sequence]
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [simplify nfsd4_encode_sequence error handling]
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      b85d4c01
    • A
      nfsd41: exchange_id operation · 0733d213
      Andy Adamson 提交于
      Implement the exchange_id operation confoming to
      http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-28
      
      Based on the client provided name, hash a client id.
      If a confirmed one is found, compare the op's creds and
      verifier.  If the creds match and the verifier is different
      then expire the old client (client re-incarnated), otherwise,
      if both match, assume it's a replay and ignore it.
      
      If an unconfirmed client is found, then copy the new creds
      and verifer if need update, otherwise assume replay.
      
      The client is moved to a confirmed state on create_session.
      
      In the nfs41 branch set the exchange_id flags to
      EXCHGID4_FLAG_USE_NON_PNFS | EXCHGID4_FLAG_SUPP_MOVED_REFER
      (pNFS is not supported, Referrals are supported,
      Migration is not.).
      
      Address various scenarios from section 18.35 of the spec:
      
      1. Check for EXCHGID4_FLAG_UPD_CONFIRMED_REC_A and set
         EXCHGID4_FLAG_CONFIRMED_R as appropriate.
      
      2. Return error codes per 18.35.4 scenarios.
      
      3. Update client records or generate new client ids depending on
         scenario.
      
      Note: 18.35.4 case 3 probably still needs revisiting.  The handling
      seems not quite right.
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NAndy Adamosn <andros@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfsd41: use utsname for major_id (and copy to server_scope)]
      [nfsd41: fix handling of various exchange id scenarios]
      Signed-off-by: NMike Sager <sager@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfsd41: reverse use of EXCHGID4_INVAL_FLAG_MASK_A]
      [simplify nfsd4_encode_exchange_id error handling]
      [nfsd41: embed an xdr_netobj in nfsd4_exchange_id]
      [nfsd41: return nfserr_serverfault for spa_how == SP4_MACH_CRED]
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      0733d213
    • A
      nfsd41: xdr infrastructure · 2db134eb
      Andy Adamson 提交于
      Define nfsd41_dec_ops vector and add it to nfsd4_minorversion for
      minorversion 1.
      
      Note: nfsd4_enc_ops vector is shared for v4.0 and v4.1
      since we don't need to filter out obsolete ops as this is
      done in the decoding phase.
      
      exchange_id, create_session, destroy_session, and sequence ops are
      implemented as stubs returning nfserr_opnotsupp at this stage.
      
      [was nfsd41: xdr stubs]
      [get rid of CONFIG_NFSD_V4_1]
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      2db134eb
  2. 19 3月, 2009 2 次提交
  3. 18 3月, 2009 1 次提交
  4. 08 1月, 2009 1 次提交
  5. 30 9月, 2008 6 次提交
  6. 19 7月, 2008 2 次提交
  7. 05 7月, 2008 1 次提交
  8. 03 7月, 2008 4 次提交
  9. 24 6月, 2008 1 次提交
    • B
      nfsd: make nfs4xdr WRITEMEM safe against zero count · 13b1867c
      Benny Halevy 提交于
      WRITEMEM zeroes the last word in the destination buffer
      for padding purposes, but this must not be done if
      no bytes are to be copied, as it would result
      in zeroing of the word right before the array.
      
      The current implementation works since it's always called
      with non zero nbytes or it follows an encoding of the
      string (or opaque) length which, if equal to zero,
      can be overwritten with zero.
      
      Nevertheless, it seems safer to check for this case.
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      13b1867c
  10. 26 4月, 2008 1 次提交
  11. 24 4月, 2008 1 次提交
  12. 15 2月, 2008 1 次提交
  13. 02 2月, 2008 2 次提交
    • F
      nfsd: Allow AIX client to read dir containing mountpoints · 406a7ea9
      Frank Filz 提交于
      This patch addresses a compatibility issue with a Linux NFS server and
      AIX NFS client.
      
      I have exported /export as fsid=0 with sec=krb5:krb5i
      I have mount --bind /home onto /export/home
      I have exported /export/home with sec=krb5i
      
      The AIX client mounts / -o sec=krb5:krb5i onto /mnt
      
      If I do an ls /mnt, the AIX client gets a permission error. Looking at
      the network traceIwe see a READDIR looking for attributes
      FATTR4_RDATTR_ERROR and FATTR4_MOUNTED_ON_FILEID. The response gives a
      NFS4ERR_WRONGSEC which the AIX client is not expecting.
      
      Since the AIX client is only asking for an attribute that is an
      attribute of the parent file system (pseudo root in my example), it
      seems reasonable that there should not be an error.
      
      In discussing this issue with Bruce Fields, I initially proposed
      ignoring the error in nfsd4_encode_dirent_fattr() if all that was being
      asked for was FATTR4_RDATTR_ERROR and FATTR4_MOUNTED_ON_FILEID, however,
      Bruce suggested that we avoid calling cross_mnt() if only these
      attributes are requested.
      
      The following patch implements bypassing cross_mnt() if only
      FATTR4_RDATTR_ERROR and FATTR4_MOUNTED_ON_FILEID are called. Since there
      is some complexity in the code in nfsd4_encode_fattr(), I didn't want to
      duplicate code (and introduce a maintenance nightmare), so I added a
      parameter to nfsd4_encode_fattr() that indicates whether it should
      ignore cross mounts and simply fill in the attribute using the passed in
      dentry as opposed to it's parent.
      Signed-off-by: NFrank Filz <ffilzlnx@us.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      406a7ea9
    • J
      nfsd: Fix handling of negative lengths in read_buf() · ca2a05aa
      J. Bruce Fields 提交于
      The length "nbytes" passed into read_buf should never be negative, but
      we check only for too-large values of "nbytes", not for too-small
      values.  Make nbytes unsigned, so it's clear that the former tests are
      sufficient.  (Despite this read_buf() currently correctly returns an xdr
      error in the case of a negative length, thanks to an unsigned
      comparison with size_of() and bounds-checking in kmalloc().  This seems
      very fragile, though.)
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      ca2a05aa
  14. 10 10月, 2007 3 次提交
  15. 27 7月, 2007 1 次提交
  16. 18 7月, 2007 3 次提交
  17. 09 5月, 2007 1 次提交
  18. 17 2月, 2007 3 次提交
  19. 15 2月, 2007 1 次提交
  20. 27 1月, 2007 1 次提交
    • N
      [PATCH] knfsd: Fix type mismatch with filldir_t used by nfsd · a0ad13ef
      NeilBrown 提交于
      nfsd defines a type 'encode_dent_fn' which is much like 'filldir_t' except
      that the first pointer is 'struct readdir_cd *' rather than 'void *'.  It
      then casts encode_dent_fn points to 'filldir_t' as needed.  This hides any
      other type mismatches between the two such as the fact that the 'ino' arg
      recently changed from ino_t to u64.
      
      So: get rid of 'encode_dent_fn', get rid of the cast of the function type,
      change the first arg of various functions from 'struct readdir_cd *' to
      'void *', and live with the fact that we have a little less type checking
      on the calling of these functions now.  Less internal (to nfsd) checking
      offset by more external checking, which is more important.
      
      Thanks to Gabriel Paubert <paubert@iram.es> for discovering this and
      providing an initial patch.
      Signed-off-by: NGabriel Paubert <paubert@iram.es>
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a0ad13ef
  21. 14 12月, 2006 1 次提交