22 Oct, 2007

1 commit

  • Now that all filesystems are converted remove support for the old methods.

    Signed-off-by: Christoph Hellwig
    Cc: Neil Brown
    Cc: "J. Bruce Fields"
    Cc:
    Cc: Dave Kleikamp
    Cc: Anton Altaparmakov
    Cc: David Chinner
    Cc: Timothy Shimmin
    Cc: OGAWA Hirofumi
    Cc: Hugh Dickins
    Cc: Chris Mason
    Cc: Jeff Mahoney
    Cc: "Vladimir V. Saveliev"
    Cc: Steven Whitehouse
    Cc: Mark Fasheh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

17 Oct, 2007

1 commit


01 Aug, 2007

1 commit

  • A succesful downcall with a negative result (which indicates that the given
    filesystem is not exported to the given user) should not return an error.

    Currently mountd is depending on stdio to write these downcalls. With some
    versions of libc this appears to cause subsequent writes to attempt to write
    all accumulated data (for which writes previously failed) along with any new
    data. This can prevent the kernel from seeing responses to later downcalls.
    Symptoms will be that nfsd fails to respond to certain requests.

    Signed-off-by: "J. Bruce Fields"
    Cc: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     

22 Jul, 2007

1 commit


20 Jul, 2007

1 commit

  • I converted the various export-returning functions to return -ENOENT instead
    of NULL, but missed a few cases.

    This particular case could cause actual bugs in the case of a krb5 client that
    doesn't match any ip-based client and that is trying to access a filesystem
    not exported to krb5 clients.

    Signed-off-by: "J. Bruce Fields"
    Acked-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     

18 Jul, 2007

10 commits

  • Add secinfo information to the display in proc/net/sunrpc/nfsd.export/content.

    Signed-off-by: "J. Bruce Fields"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • Factor out some code to be shared by secinfo display code. Remove some
    unnecessary conditional printing of commas where we know the condition is
    true.

    Signed-off-by: "J. Bruce Fields"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • Make the first actual use of the secinfo information by using it to return
    nfserr_wrongsec when an export is found that doesn't allow the flavor used on
    this request.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Andy Adamson
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Adamson
     
  • With this patch, we fall back on using the gss/pseudoflavor only if we fail to
    find a matching auth_unix export that has a secinfo list.

    As long as sec= options aren't used, there's still no change in behavior here
    (except possibly for some additional auth_unix cache lookups, whose results
    will be ignored).

    The sec= option, however, is not actually enforced yet; later patches will add
    the necessary checks.

    Signed-off-by: "J. Bruce Fields"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • We want it to be possible for users to restrict exports both by IP address and
    by pseudoflavor. The pseudoflavor information has previously been passed
    using special auth_domains stored in the rq_client field. After the preceding
    patch that stored the pseudoflavor in rq_pflavor, that's now superfluous; so
    now we use rq_client for the ip information, as auth_null and auth_unix do.

    However, we keep around the special auth_domain in the rq_gssclient field for
    backwards compatibility purposes, so we can still do upcalls using the old
    "gss/pseudoflavor" auth_domain if upcalls using the unix domain to give us an
    appropriate export. This allows us to continue supporting old mountd.

    In fact, for this first patch, we always use the "gss/pseudoflavor"
    auth_domain (and only it) if it is available; thus rq_client is ignored in the
    auth_gss case, and this patch on its own makes no change in behavior; that
    will be left to later patches.

    Note on idmap: I'm almost tempted to just replace the auth_domain in the idmap
    upcall by a dummy value--no version of idmapd has ever used it, and it's
    unlikely anyone really wants to perform idmapping differently depending on the
    where the client is (they may want to perform *credential* mapping
    differently, but that's a different matter--the idmapper just handles id's
    used in getattr and setattr). But I'm updating the idmapd code anyway, just
    out of general backwards-compatibility paranoia.

    Signed-off-by: "J. Bruce Fields"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • Split the callers of exp_get_by_name(), exp_find(), and exp_parent() into
    those that are processing requests and those that are doing other stuff (like
    looking up filehandles for mountd).

    No change in behavior, just a (fairly pointless, on its own) cleanup.

    (Note this has the effect of making nfsd_cross_mnt() pass rqstp->rq_client
    instead of exp->ex_client into exp_find_by_name(). However, the two should
    have the same value at this point.)

    Signed-off-by: "J. Bruce Fields"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • We're passing three arguments to exp_pseudoroot, two of which are just fields
    of the svc_rqst. Soon we'll want to pass in a third field as well. So let's
    just give up and pass in the whole struct svc_rqst.

    Also sneak in some minor style cleanups while we're at it.

    Signed-off-by: "J. Bruce Fields"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • We add a list of pseudoflavors to each export downcall, which will be used
    both as a list of security flavors allowed on that export, and (in the order
    given) as the list of pseudoflavors to return on secinfo calls.

    This patch parses the new downcall information and adds it to the export
    structure, but doesn't use it for anything yet.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Andy Adamson
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Adamson
     
  • Currently exp_find(), exp_get_by_name(), and friends, return an export on
    success, and on failure return:

    errors -EAGAIN (drop this request pending an upcall) or
    -ETIMEDOUT (an upcall has timed out), or
    return NULL, which can mean either that there was a memory allocation
    failure, or that an export was not found, or that a passed-in
    export lacks an auth_domain.

    Many callers seem to assume that NULL means that an export was not found,
    which may lead to bugs in the case of a memory allocation failure.

    Modify these functions to distinguish between the two NULL cases by returning
    either -ENOENT or -ENOMEM. They now never return NULL. We get to simplify
    some code in the process.

    We return -ENOENT in the case of a missing auth_domain. This case should
    probably be removed (or converted to a bug) after confirming that it can never
    happen.

    Signed-off-by: "J. Bruce Fields"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     
  • currently the export_operation structure and helpers related to it are in
    fs.h. fs.h is already far too large and there are very few places needing the
    export bits, so split them off into a separate header.

    [akpm@linux-foundation.org: fix cifs build]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Neil Brown
    Cc: Steven French
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

10 May, 2007

1 commit


15 Feb, 2007

2 commits

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     
  • Add support for using a filesystem UUID to identify and export point in the
    filehandle.

    For NFSv2, this UUID is xor-ed down to 4 or 8 bytes so that it doesn't take up
    too much room. For NFSv3+, we use the full 16 bytes, and possibly also a
    64bit inode number for exports beneath the root of a filesystem.

    When generating an fsid to return in 'stat' information, use the UUID (hashed
    down to size) if it is available and a small 'fsid' was not specifically
    provided.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     

31 Jan, 2007

1 commit


14 Dec, 2006

4 commits

  • The nfsservctl system call isn't used but recent nfs-utils releases for
    exporting filesystems, and consequently the code that is uses - exp_export -
    has suffered some bitrot.

    Particular:
    - some newly added fields in 'struct svc_export' are being initialised
    properly.
    - the return value is now always -ENOMEM ...

    This patch fixes both these problems.

    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • To avoid tying up server threads when nfsd makes an upcall (to mountd, to get
    export options, to idmapd, for nfsv4 nameid mapping, etc.), we temporarily
    "drop" the request and save enough information so that we can revisit it
    later.

    Certain failures during the deferral process can cause us to really drop the
    request and never revisit it.

    This is often less than ideal, and is unacceptable in the NFSv4 case--rfc 3530
    forbids the server from dropping a request without also closing the
    connection.

    As a first step, we modify the deferral code to return -ETIMEDOUT (which is
    translated to nfserr_jukebox in the v3 and v4 cases, and remains a drop in the
    v2 case).

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • Note there's no need for special handling of -EAGAIN here; nfserrno() does
    what we want already. So this is a pure cleanup with no change in
    functionality.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     
  • Since exp_parent can fail by returning an error (-EAGAIN) in addition to by
    returning NULL, we should check for that case in exp_rootfh.

    (TODO: we should check that userland handles these errors too.)

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J.Bruce Fields
     

21 Oct, 2006

1 commit


04 Oct, 2006

4 commits


02 Oct, 2006

4 commits


01 Jul, 2006

1 commit

  • Type '3' is used for the fsid in filehandles when the device number of the
    device holding the filesystem has more than 8 bits in either major or minor.
    Unfortunately expkey_parse doesn't recognise type 3. Fix this.

    (Slighty modified from Frank's original)

    Signed-off-by: Frank Filz
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Frank Filz
     

24 May, 2006

1 commit

  • Both cause the 'entries' count in the export cache to be non-zero at module
    removal time, so unregistering that cache fails and results in an oops.

    1/ exp_pseudoroot (used for NFSv4 only) leaks a reference to an export
    entry.
    2/ sunrpc_cache_update doesn't increment the entries count when it adds
    an entry.

    Thanks to "david m. richter" for triggering the
    problem and finding one of the bugs.

    Cc: "david m. richter"
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     

11 Apr, 2006

1 commit

  • Export a directory that does not exist:
    exportfs -orw,fsid=0,insecure,no_subtree_check client:/home/NFS4

    Try to mount from client with nfs4. Mount hangs (I'm not sure why -
    that's another issue).

    While client is hung, back on server

    mkdir /home/NFS4

    The server panics in dput. I traced the problem back to svc_export_parse()
    calling path_release() even though path_lookup() failed (it happens to fill in
    the nameidata structure with a negative dentry - so the test after out:
    succeeds).

    After patching, an recreating the problem, the client mount still takes some
    time before finally exiting with a message "couldn't read superblock".

    Here is a simple patch to resolve this issue:

    Signed-off-by: Frank Filz
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     

28 Mar, 2006

5 commits