1. 30 3月, 2013 2 次提交
    • C
      NFS: Avoid PUTROOTFH when managing leases · 83ca7f5a
      Chuck Lever 提交于
      Currently, the compound operation the Linux NFS client sends to the
      server to confirm a client ID looks like this:
      
      	{ SETCLIENTID_CONFIRM; PUTROOTFH; GETATTR(lease_time) }
      
      Once the lease is confirmed, it makes sense to know how long before
      the client will have to renew it.  And, performing these operations
      in the same compound saves a round trip.
      
      Unfortunately, this arrangement assumes that the security flavor
      used for establishing a client ID can also be used to access the
      server's pseudo-fs.
      
      If the server requires a different security flavor to access its
      pseudo-fs than it allowed for the client's SETCLIENTID operation,
      the PUTROOTFH in this compound fails with NFS4ERR_WRONGSEC.  Even
      though the SETCLIENTID_CONFIRM succeeded, our client's trunking
      detection logic interprets the failure of the compound as a failure
      by the server to confirm the client ID.
      
      As part of server trunking detection, the client then begins another
      SETCLIENTID pass with the same nfs4_client_id.  This fails with
      NFS4ERR_CLID_INUSE because the first SETCLIENTID/SETCLIENTID_CONFIRM
      already succeeded in confirming that client ID -- it was the
      PUTROOTFH operation that caused the SETCLIENTID_CONFIRM compound to
      fail.
      
      To address this issue, separate the "establish client ID" step from
      the "accessing the server's pseudo-fs root" step.  The first access
      of the server's pseudo-fs may require retrying the PUTROOTFH
      operation with different security flavors.  This access is done in
      nfs4_proc_get_rootfh().
      
      That leaves the matter of how to retrieve the server's lease time.
      nfs4_proc_fsinfo() already retrieves the lease time value, though
      none of its callers do anything with the retrieved value (nor do
      they mark the lease as "renewed").
      
      Note that NFSv4.1 state recovery invokes nfs4_proc_get_lease_time()
      using the lease management security flavor.  This may cause some
      heartburn if that security flavor isn't the same as the security
      flavor the server requires for accessing the pseudo-fs.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Cc: Bryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      83ca7f5a
    • C
      SUNRPC: Define rpcsec_gss_info structure · fb15b26f
      Chuck Lever 提交于
      The NFSv4 SECINFO procedure returns a list of security flavors.  Any
      GSS flavor also has a GSS tuple containing an OID, a quality-of-
      protection value, and a service value, which specifies a particular
      GSS pseudoflavor.
      
      For simplicity and efficiency, I'd like to return each GSS tuple
      from the NFSv4 SECINFO XDR decoder and pass it straight into the RPC
      client.
      
      Define a data structure that is visible to both the NFS client and
      the RPC client.  Take structure and field names from the relevant
      standards to avoid confusion.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      fb15b26f
  2. 29 3月, 2013 1 次提交
    • T
      NFSv4: Fix Oopses in the fs_locations code · 809b426c
      Trond Myklebust 提交于
      If the server sends us a pathname with more components than the client
      limit of NFS4_PATHNAME_MAXCOMPONENTS, more server entries than the client
      limit of NFS4_FS_LOCATION_MAXSERVERS, or sends a total number of
      fs_locations entries than the client limit of NFS4_FS_LOCATIONS_MAXENTRIES
      then we will currently Oops because the limit checks are done _after_ we've
      decoded the data into the arrays.
      
      Reported-by: fanchaoting<fanchaoting@cn.fujitsu.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      809b426c
  3. 26 3月, 2013 2 次提交
  4. 13 2月, 2013 1 次提交
    • E
      nfs: Convert nfs4xdr to use kuids and kgids · e5782076
      Eric W. Biederman 提交于
      When reading uids and gids off the wire convert them to
      kuids and kgids.
      
      When putting kuids and kgids onto the wire first convert
      them to uids and gids the other side will understand.
      
      When printing kuids and kgids convert them to values in
      the initial user namespace then use normal printf formats.
      
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      e5782076
  5. 06 12月, 2012 3 次提交
  6. 27 11月, 2012 3 次提交
  7. 22 11月, 2012 1 次提交
  8. 05 11月, 2012 1 次提交
  9. 03 10月, 2012 2 次提交
  10. 02 10月, 2012 1 次提交
    • W
      NFSv4: Add ACCESS operation to OPEN compound · 6168f62c
      Weston Andros Adamson 提交于
      The OPEN operation has no way to differentiate an open for read and an
      open for execution - both look like read to the server. This allowed
      users to read files that didn't have READ access but did have EXEC access,
      which is obviously wrong.
      
      This patch adds an ACCESS call to the OPEN compound to handle the
      difference between OPENs for reading and execution.  Since we're going
      through the trouble of calling ACCESS, we check all possible access bits
      and cache the results hopefully avoiding an ACCESS call in the future.
      Signed-off-by: NWeston Andros Adamson <dros@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6168f62c
  11. 29 9月, 2012 1 次提交
  12. 27 9月, 2012 1 次提交
  13. 07 9月, 2012 1 次提交
  14. 06 9月, 2012 1 次提交
  15. 17 8月, 2012 2 次提交
  16. 31 7月, 2012 2 次提交
  17. 29 6月, 2012 4 次提交
  18. 05 6月, 2012 2 次提交
    • T
      NFSv4: Fix up decode_attr_mdsthreshold · 029c5347
      Trond Myklebust 提交于
      Fix an incorrect use of 'likely()'. The FATTR4_WORD2_MDSTHRESHOLD
      bit is only expected in NFSv4.1 OPEN calls, and so is actually
      rather _unlikely_.
      
      decode_attr_mdsthreshold needs to clear FATTR4_WORD2_MDSTHRESHOLD
      from the attribute bitmap after it has decoded the data.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Andy Adamson <andros@netapp.com>
      029c5347
    • T
      NFSv4: Fix an Oops in the open recovery code · 1549210f
      Trond Myklebust 提交于
      The open recovery code does not need to request a new value for the
      mdsthreshold, and so does not allocate a struct nfs4_threshold.
      The problem is that encode_getfattr_open() will still request an
      mdsthreshold, and so we end up Oopsing in decode_attr_mdsthreshold.
      
      This patch fixes encode_getfattr_open so that it doesn't request an
      mdsthreshold when the caller isn't asking for one. It also fixes
      decode_attr_mdsthreshold so that it errors if the server returns
      an mdsthreshold that we didn't ask for (instead of Oopsing).
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Andy Adamson <andros@netapp.com>
      1549210f
  19. 27 5月, 2012 2 次提交
  20. 26 5月, 2012 1 次提交
  21. 25 5月, 2012 2 次提交
  22. 23 5月, 2012 2 次提交
    • C
      NFS: EXCHANGE_ID should save the server major and minor ID · acdeb69d
      Chuck Lever 提交于
      Save the server major and minor ID results from EXCHANGE_ID, as they
      are needed for detecting server trunking.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      acdeb69d
    • C
      NFS: Always use the same SETCLIENTID boot verifier · f092075d
      Chuck Lever 提交于
      Currently our NFS client assigns a unique SETCLIENTID boot verifier
      for each server IP address it knows about.  It's set to CURRENT_TIME
      when the struct nfs_client for that server IP is created.
      
      During the SETCLIENTID operation, our client also presents an
      nfs_client_id4 string to servers, as an identifier on which the server
      can hang all of this client's NFSv4 state.  Our client's
      nfs_client_id4 string is unique for each server IP address.
      
      An NFSv4 server is obligated to wipe all NFSv4 state associated with
      an nfs_client_id4 string when the client presents the same
      nfs_client_id4 string along with a changed SETCLIENTID boot verifier.
      
      When our client unmounts the last of a server's shares, it destroys
      that server's struct nfs_client.  The next time the client mounts that
      NFS server, it creates a fresh struct nfs_client with a fresh boot
      verifier.  On seeing the fresh verifer, the server wipes any previous
      NFSv4 state associated with that nfs_client_id4.
      
      However, NFSv4.1 clients are supposed to present the same
      nfs_client_id4 string to all servers.  And, to support Transparent
      State Migration, the same nfs_client_id4 string should be presented
      to all NFSv4.0 servers so they recognize that migrated state for this
      client belongs with state a server may already have for this client.
      (This is known as the Uniform Client String model).
      
      If the nfs_client_id4 string is the same but the boot verifier changes
      for each server IP address, SETCLIENTID and EXCHANGE_ID operations
      from such a client could unintentionally result in a server wiping a
      client's previously obtained lease.
      
      Thus, if our NFS client is going to use a fixed nfs_client_id4 string,
      either for NFSv4.0 or NFSv4.1 mounts, our NFS client should use a
      boot verifier that does not change depending on server IP address.
      Replace our current per-nfs_client boot verifier with a per-nfs_net
      boot verifier.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      f092075d
  23. 02 5月, 2012 2 次提交