10 Feb, 2010

1 commit

  • It was recently pointed out that the NFSERR_SERVERFAULT error, which is
    designed to inform the user of a serious internal error on the server, was
    being mapped to an error value that is internal to the kernel.

    This patch maps it to the error EREMOTEIO, which is exported to userland
    through errno.h.

    Signed-off-by: Trond Myklebust
    Cc: stable@kernel.org

    Trond Myklebust
     

11 Aug, 2009

1 commit


10 Aug, 2009

2 commits

  • After certain failure modes of an NFS mount, an NFS client should send
    a MOUNTPROC_UMNT request to remove the just-added mount entry from the
    server's mount table. While no-one should rely on the accuracy of the
    server's mount table, sending a UMNT is simply being a good internet
    neighbor.

    Since NFS mount processing is handled in the kernel now, we will need
    a function in the kernel's mountd client that can post a MOUNTRPC_UMNT
    request, in order to handle these failure modes.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Ensure that index i remains within array mnt_errtbl[] and mnt3_errtbl[].

    Signed-off-by: Roel Kluin
    Signed-off-by: Trond Myklebust

    Roel Kluin
     

18 Jun, 2009

8 commits

  • Clean up: Remove xdr_decode_fhstatus() and xdr_decode_fhstatus3(), now
    that they are unused.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Solder xdr_stream-based XDR decoding functions into the in-kernel mountd
    client that are more careful about checking data types and watching for
    buffer overflows. The new MNT3 decoder includes support for auth-flavor
    list decoding.

    The "_sz" macro for MNT3 replies was missing the size of the file handle.
    I've added this back, and included the size of the auth flavor array.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Introduce an xdr_stream-based XDR decoder that can unpack the auth-
    flavor list returned in a MNT3 reply.

    The nfs_mount() function's caller allocates an array, and passes the
    size and a pointer to it. The decoder decodes all the flavors it can
    into the array, and returns the number of decoded flavors.

    If the caller is not interested in the auth flavors, it can pass a
    value of zero as the size of the pre-allocated array.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Introduce xdr_stream-based XDR file handle decoders to the in-kernel
    mountd client. These are more careful than the existing decoder
    functions about buffer overflows and data type and range checking.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Introduce data structures and xdr_stream-based decoding functions for
    unmarshalling mountd status codes properly.

    Mountd version 3 uses specific standard error return codes that are
    not errno values and not NFS3ERR_ values. These have a well-defined
    standard mapping to local errno values. Introduce data structures
    and a decoder function that map these status codes to local errno
    values properly. This is new functionality (but not used yet).

    Version 1 mountd status values are defined by RFC 1094 as UNIX error
    values (errno values). Errno values on heterogeneous systems do not
    necessarily match each other. To avoid exposing possibly incorrect
    errno values to upper layers, the current XDR decoder converts all
    non-zero MNT version 1 status codes to -EACCES.

    The OpenGroup XNFS standard provides a mapping similar to but smaller
    than the version 3 error codes. Implement a decoder that uses the XNFS
    error codes, replacing the current decoder.

    For both mountd protocol versions, map unrecognized errors to -EACCES.

    Finally we introduce a replacement data structure for mnt_fhstatus
    at this time, which is used by the new XDR decoders. In addition to
    documenting that the status value returned by the XDR decoders is
    always an errno, this new structure will be expanded in subsequent
    patches.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Clean up: remove xdr_encode_dirpath() now that it has been replaced.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Check the length of the supplied dirpath, and see that it fits
    properly in the RPC buffer.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Clean up: Relocate MNT program procedure number definitions to the
    only file that uses them. Relocate the version number definitions,
    which are shared, to nfs.h. Remove duplicate program number
    definitions.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

24 Dec, 2008

2 commits


08 Oct, 2008

1 commit

  • This patch fixes a regression that was introduced by the string based mounts.

    nfs_mount() statically returns -EACCES for every error returned
    by the remote mounted. This is incorrect because -EACCES is
    an non-fatal error to the mount.nfs command. This error causes
    mount.nfs to retry the mount even in the case when the exported
    directory does not exist.

    This patch maps the errors returned by the remote mountd into
    valid errno values, exactly how it was done pre-string based
    mounts. By returning the correct errno enables mount.nfs
    to do the right thing.

    Signed-off-by: Steve Dickson
    [Trond.Myklebust@netapp.com: nfs_stat_to_errno() now correctly returns
    negative errors, so remove the sign change.]
    Signed-off-by: Trond Myklebust

    Steve Dickson
     

24 Jun, 2008

1 commit


07 Dec, 2007

1 commit


11 Jul, 2007

5 commits


01 May, 2007

1 commit

  • The RPC buffer size estimation logic in net/sunrpc/clnt.c always
    significantly overestimates the requirements for the buffer size.
    A little instrumentation demonstrated that in fact rpc_malloc was never
    allocating the buffer from the mempool, but almost always called kmalloc.

    To compute the size of the RPC buffer more precisely, split p_bufsiz into
    two fields; one for the argument size, and one for the result size.

    Then, compute the sum of the exact call and reply header sizes, and split
    the RPC buffer precisely between the two. That should keep almost all RPC
    buffers within the 2KiB buffer mempool limit.

    And, we can finally be rid of RPC_SLACK_SPACE!

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

21 Oct, 2006

1 commit


23 Sep, 2006

2 commits

  • Teach NFS_ROOT to use the new rpc_create API instead of the old two-call
    API for creating an RPC transport.

    Test plan:
    Compile the kernel with the NFS client build-in, and set CONFIG_NFS_ROOT.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • include/linux/sunrpc/clnt.h already includes include/linux/sunrpc/xprt.h.
    We can remove xprt.h from source files that already include clnt.h.
    Likewise include/linux/sunrpc/timer.h.

    Test plan:
    Compile kernel with CONFIG_NFS enabled.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

26 Mar, 2006

1 commit

  • * git://git.linux-nfs.org/pub/linux/nfs-2.6: (103 commits)
    SUNRPC,RPCSEC_GSS: spkm3--fix config dependencies
    SUNRPC,RPCSEC_GSS: spkm3: import contexts using NID_cast5_cbc
    LOCKD: Make nlmsvc_traverse_shares return void
    LOCKD: nlmsvc_traverse_blocks return is unused
    SUNRPC,RPCSEC_GSS: fix krb5 sequence numbers.
    NFSv4: Dont list system.nfs4_acl for filesystems that don't support it.
    SUNRPC,RPCSEC_GSS: remove unnecessary kmalloc of a checksum
    SUNRPC: Ensure rpc_call_async() always calls tk_ops->rpc_release()
    SUNRPC: Fix memory barriers for req->rq_received
    NFS: Fix a race in nfs_sync_inode()
    NFS: Clean up nfs_flush_list()
    NFS: Fix a race with PG_private and nfs_release_page()
    NFSv4: Ensure the callback daemon flushes signals
    SUNRPC: Fix a 'Busy inodes' error in rpc_pipefs
    NFS, NLM: Allow blocking locks to respect signals
    NFS: Make nfs_fhget() return appropriate error values
    NFSv4: Fix an oops in nfs4_fill_super
    lockd: blocks should hold a reference to the nlm_file
    NFSv4: SETCLIENTID_CONFIRM should handle NFS4ERR_DELAY/NFS4ERR_RESOURCE
    NFSv4: Send the delegation stateid for SETATTR calls
    ...

    Linus Torvalds
     

24 Mar, 2006

1 commit

  • Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a
    duplicate of ARRAY_SIZE. Some trailing whitespaces are also deleted.

    Signed-off-by: Tobias Klauser
    Cc: David Howells
    Cc: Dave Kleikamp
    Acked-by: Trond Myklebust
    Cc: Neil Brown
    Cc: Chris Mason
    Cc: Jeff Mahoney
    Cc: Christoph Hellwig
    Cc: Nathan Scott
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tobias Klauser
     

21 Mar, 2006

2 commits

  • Clean-up: replace rpc_call() helper with direct call to rpc_call_sync.

    This makes NFSv2 and NFSv3 synchronous calls more computationally
    efficient, and reduces stack consumption in functions that used to
    invoke rpc_call more than once.

    Test plan:
    Compile kernel with CONFIG_NFS enabled. Connectathon on NFS version 2,
    version 3, and version 4 mount points.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Add fields to the rpc_procinfo struct that allow the display of a
    human-readable name for each procedure in the rpc_iostats output.

    Also fix it so that the NFSv4 stats are broken up correctly by
    sub-procedure number. NFSv4 uses only two real RPC procedures:
    NULL, and COMPOUND.

    Test plan:
    Mount with NFSv2, NFSv3, and NFSv4, and do "cat /proc/self/mountstats".

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

07 Jan, 2006

1 commit

  • Clean up: Every ULP that uses the in-kernel RPC client, except the NLM
    client, sets cl_chatty. There's no reason why NLM shouldn't set it, so
    just get rid of cl_chatty and always be verbose.

    Test-plan:
    Compile with CONFIG_NFS enabled.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

23 Jun, 2005

1 commit


17 Apr, 2005

1 commit

  • 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!

    Linus Torvalds