1. 04 4月, 2009 7 次提交
    • A
      nfsd41: create_session operation · ec6b5d7b
      Andy Adamson 提交于
      Implement the create_session operation confoming to
      http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26
      
      Look up the client id (generated by the server on exchange_id,
      given by the client on create_session).
      If neither a confirmed or unconfirmed client is found
      then the client id is stale
      If a confirmed cilent is found (i.e. we already received
      create_session for it) then compare the sequence id
      to determine if it's a replay or possibly a mis-ordered rpc.
      If the seqid is in order, update the confirmed client seqid
      and procedd with updating the session parameters.
      
      If an unconfirmed client_id is found then verify the creds
      and seqid.  If both match move the client id to confirmed state
      and proceed with processing the create_session.
      
      Currently, we do not support persistent sessions, and RDMA.
      
      alloc_init_session generates a new sessionid and creates
      a session structure.
      
      NFSD_PAGES_PER_SLOT is used for the max response cached calculation, and for
      the counting of DRC pages using the hard limits set in struct srv_serv.
      
      A note on NFSD_PAGES_PER_SLOT:
      
      Other patches in this series allow for NFSD_PAGES_PER_SLOT + 1 pages to be
      cached in a DRC slot when the response size is less than NFSD_PAGES_PER_SLOT *
      PAGE_SIZE but xdr_buf pages are used. e.g. a READDIR operation will encode a
      small amount of data in the xdr_buf head, and then the READDIR in the xdr_buf
      pages.  So, the hard limit calculation use of pages by a session is
      underestimated by the number of cached operations using the xdr_buf pages.
      
      Yet another patch caches no pages for the solo sequence operation, or any
      compound where cache_this is False.  So the hard limit calculation use of
      pages by a session is overestimated by the number of these operations in the
      cache.
      
      TODO: improve resource pre-allocation and negotiate session
      parameters accordingly.  Respect and possibly adjust
      backchannel attributes.
      Signed-off-by: NMarc Eshel <eshel@almaden.ibm.com>
      Signed-off-by: NDean Hildebrand <dhildeb@us.ibm.com>
      [nfsd41: remove headerpadsz from channel attributes]
      Our client and server only support a headerpadsz of 0.
      [nfsd41: use DRC limits in fore channel init]
      [nfsd41: do not change CREATE_SESSION back channel attrs]
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [use sessionid_lock spin lock]
      [nfsd41: use bool inuse for slot state]
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfsd41 remove sl_session from alloc_init_session]
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [simplify nfsd4_encode_create_session error handling]
      [nfsd41: fix comment style in init_forechannel_attrs]
      [nfsd41: allocate struct nfsd4_session and slot table in one piece]
      [nfsd41: no need to INIT_LIST_HEAD in alloc_init_session just prior to list_add]
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      ec6b5d7b
    • A
      nfsd41: nfsd DRC logic · da3846a2
      Andy Adamson 提交于
      Replay a request in nfsd4_sequence.
      Add a minorversion to struct nfsd4_compound_state.
      
      Pass the current slot to nfs4svc_encode_compound res via struct
      nfsd4_compoundres to set an NFSv4.1 DRC entry.
      
      Signed-off-by: Andy Adamson<andros@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfsd41: use bool inuse for slot state]
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      [nfsd41: use cstate session in nfs4svc_encode_compoundres]
      [nfsd41 replace nfsd4_set_cache_entry]
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      da3846a2
    • A
      nfsd41: DRC save, restore, and clear functions · 074fe897
      Andy Adamson 提交于
      Cache all the result pages, including the rpc header in rq_respages[0],
      for a request in the slot table cache entry.
      
      Cache the statp pointer from nfsd_dispatch which points into rq_respages[0]
      just past the rpc header. When setting a cache entry, calculate and save the
      length of the nfs data minus the rpc header for rq_respages[0].
      
      When replaying a cache entry, replace the cached rpc header with the
      replayed request rpc result header, unless there is not enough room in the
      cached results first page. In that case, use the cached rpc header.
      
      The sessions fore channel maxresponse size cached is set to NFSD_PAGES_PER_SLOT
      * PAGE_SIZE. For compounds we are cacheing with operations such as READDIR
      that use the xdr_buf->pages to hold data, we choose to cache the extra page of
      data rather than copying data from xdr_buf->pages into the xdr_buf->head page.
      
      [nfsd41: limit cache to maxresponsesize_cached]
      [nfsd41: mv nfsd4_set_statp under CONFIG_NFSD_V4_1]
      [nfsd41: rename nfsd4_move_pages]
      [nfsd41: rename page_no variable]
      [nfsd41: rename nfsd4_set_cache_entry]
      [nfsd41: fix nfsd41_copy_replay_data comment]
      [nfsd41: add to nfsd4_set_cache_entry]
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      074fe897
    • 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: proc stubs · 069b6ad4
      Andy Adamson 提交于
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      069b6ad4
    • 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. 30 3月, 2009 1 次提交
  3. 02 2月, 2008 1 次提交
    • 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
  4. 10 10月, 2007 1 次提交
    • P
      knfsd: 64 bit ino support for NFS server · 40ee5dc6
      Peter Staubach 提交于
      Modify the NFS server code to support 64 bit ino's, as
      appropriate for the system and the NFS protocol version.
      
      The gist of the changes is to query the underlying file system
      for attributes and not just to use the cached attributes in the
      inode.  For this specific purpose, the inode only contains an
      ino field which unsigned long, which is large enough on 64 bit
      platforms, but is not large enough on 32 bit platforms.
      
      I haven't been able to find any reason why ->getattr can't be called
      while i_mutex.  The specification indicates that i_mutex is not
      required to be held in order to invoke ->getattr, but it doesn't say
      that i_mutex can't be held while invoking ->getattr.
      
      I also haven't come to any conclusions regarding the value of
      lease_get_mtime() and whether it should or should not be invoked
      by fill_post_wcc() too.  I chose not to change this because I
      thought that it was safer to leave well enough alone.  If we
      decide to make a change, it can be done separately.
      Signed-off-by: NPeter Staubach <staubach@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Acked-by: NNeil Brown <neilb@suse.de>
      40ee5dc6
  5. 18 7月, 2007 1 次提交
  6. 14 12月, 2006 3 次提交
  7. 21 10月, 2006 2 次提交
  8. 04 10月, 2006 1 次提交
    • N
      [PATCH] knfsd: Avoid excess stack usage in svc_tcp_recvfrom · 3cc03b16
      NeilBrown 提交于
      ..  by allocating the array of 'kvec' in 'struct svc_rqst'.
      
      As we plan to increase RPCSVC_MAXPAGES from 8 upto 256, we can no longer
      allocate an array of this size on the stack.  So we allocate it in 'struct
      svc_rqst'.
      
      However svc_rqst contains (indirectly) an array of the same type and size
      (actually several, but they are in a union).  So rather than waste space, we
      move those arrays out of the separately allocated union and into svc_rqst to
      share with the kvec moved out of svc_tcp_recvfrom (various arrays are used at
      different times, so there is no conflict).
      Signed-off-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3cc03b16
  9. 19 1月, 2006 1 次提交
  10. 13 9月, 2005 1 次提交
  11. 24 6月, 2005 1 次提交
  12. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4