18 Jul, 2007

8 commits

  • Our clients (like other clients, as far as I know) use only auth_sys for nlm,
    even when using rpcsec_gss for the main nfs operations.

    Administrators that want to deny non-kerberos-authenticated locking requests
    will need to turn off NFS protocol versions less than 4....

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

    J. Bruce Fields
     
  • Allow readonly access to vary depending on the pseudoflavor, using the flag
    passed with each pseudoflavor in the export downcall. The rest of the flags
    are ignored for now, though some day we might also allow id squashing to vary
    based on the flavor.

    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
     
  • 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
     
  • 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 NFSD calls directly into filesystems through the export_operations
    structure. I plan to change this interface in various ways in later patches,
    and want to avoid the export of the default operations to NFSD, so this patch
    adds two simple exportfs_encode_fh/exportfs_decode_fh helpers for NFSD to call
    instead of poking into exportfs guts.

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

    Christoph Hellwig
     
  • 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

  • When a lookup request arrives, nfsd uses information provided by userspace
    (mountd) to find the right filesystem.

    It then assumes that the same filehandle type as the incoming filehandle can
    be used to create an outgoing filehandle.

    However if mountd is buggy, or maybe just being creative, the filesystem may
    not support that filesystem type, and the kernel could oops, particularly if
    'ex_uuid' is NULL but a FSID_UUID* filehandle type is used.

    So add some proper checking that the fsid version/type from the incoming
    filehandle is actually supportable, and ignore that information if it isn't
    supportable.

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

    NeilBrown
     

09 May, 2007

1 commit


15 Mar, 2007

1 commit


15 Feb, 2007

3 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
     
  • If we are using the same version/fsid as a current filehandle, then there is
    no need to verify the the numbers are valid for this export, and they must be
    (we used them to find this export).

    This allows us to simplify the fsid selection code.

    Also change "ref_fh_version" and "ref_fh_fsid_type" to "version" and
    "fsid_type", as the important thing isn't that they are the version/type of
    the reference filehandle, but they are the chosen type for the new filehandle.

    And tidy up some indenting.

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

    NeilBrown
     

13 Feb, 2007

1 commit

  • There are loads of places where the RPC server assumes that the rq_addr fields
    contains an IPv4 address. Top among these are error and debugging messages
    that display the server's IP address.

    Let's refactor the address printing into a separate function that's smart
    enough to figure out the difference between IPv4 and IPv6 addresses.

    Signed-off-by: Chuck Lever
    Cc: Aurelien Charbon
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chuck Lever
     

02 Feb, 2007

1 commit


31 Jan, 2007

1 commit


14 Dec, 2006

1 commit

  • 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
     

21 Oct, 2006

1 commit


01 Aug, 2006

1 commit

  • A recent commit (7fc90ec93a5eb71f4b08403baf5ba7176b3ec6b1) moved the
    call to nfsd_setuser out of the 'find a dentry for a filehandle' branch
    of fh_verify so that it would always be called.

    This had the unfortunately side-effect of moving *after* the call to
    decode_fh, so the prober fsuid was not set when nfsd_acceptable was called,
    the 'permission' check did the wrong thing.

    This patch moves the nfsd_setuser call back where it was, and add as call
    in the other branch of the if.

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

    NeilBrown
     

01 Jul, 2006

3 commits

  • In the typical v2/v3 case the only new filehandles used as arguments to
    operations are filehandles taken directly off the wire, which don't get
    dentries until fh_verify() is called.

    But in v4 the filehandles that are arguments to operations were often created
    by previous operations (putrootfh, lookup, etc.) using fh_compose, which sets
    the dentry in the filehandle without calling nfsd_setuser().

    This also means that, for example, if filesystem B is mounted on filesystem A,
    and filesystem A is exported without root-squashing, then a client can bypass
    the rootsquashing on B using a compound that starts at a filehandle in A,
    crosses into B using lookups, and then does stuff in B.

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

    J. Bruce Fields
     
  • nfsd tries to return to a client the same sort of filehandle as was used by
    the client. This removes some filehandle aliasing issues and means that a
    server upgrade followed by a downgrade will not confused clients not restarted
    during that time.

    However when crossing a mountpoint, the filehandle used for one filesystem
    doesn't provide any useful information on what sort of filehandle should be
    used on the other, and can provide misleading information. So if the
    reference filehandle is on a different filesystem to the one being generated,
    ignore it.

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

    NeilBrown
     
  • There is a perfectly valid situation where fh_update gets called on an already
    uptodate filehandle - in nfsd_create_v3 where a CREATE_UNCHECKED finds an
    existing file and wants to just set the size.

    We could possible optimise out the call in that case, but the only harm
    involved is that fh_update prints a warning, so it is easier to remove the
    warning.

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

    NeilBrown
     

28 Mar, 2006

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