17 Oct, 2007

1 commit


16 Oct, 2007

2 commits

  • * 'locks' of git://linux-nfs.org/~bfields/linux:
    nfsd: remove IS_ISMNDLCK macro
    Rework /proc/locks via seq_files and seq_list helpers
    fs/locks.c: use list_for_each_entry() instead of list_for_each()
    NFS: clean up explicit check for mandatory locks
    AFS: clean up explicit check for mandatory locks
    9PFS: clean up explicit check for mandatory locks
    GFS2: clean up explicit check for mandatory locks
    Cleanup macros for distinguishing mandatory locks
    Documentation: move locks.txt in filesystems/
    locks: add warning about mandatory locking races
    Documentation: move mandatory locking documentation to filesystems/
    locks: Fix potential OOPS in generic_setlease()
    Use list_first_entry in locks_wake_up_blocks
    locks: fix flock_lock_file() comment
    Memory shortage can result in inconsistent flocks state
    locks: kill redundant local variable
    locks: reverse order of posix_locks_conflict() arguments

    Linus Torvalds
     
  • * git://git.linux-nfs.org/pub/linux/nfs-2.6: (131 commits)
    NFSv4: Fix a typo in nfs_inode_reclaim_delegation
    NFS: Add a boot parameter to disable 64 bit inode numbers
    NFS: nfs_refresh_inode should clear cache_validity flags on success
    NFS: Fix a connectathon regression in NFSv3 and NFSv4
    NFS: Use nfs_refresh_inode() in ops that aren't expected to change the inode
    SUNRPC: Don't call xprt_release in call refresh
    SUNRPC: Don't call xprt_release() if call_allocate fails
    SUNRPC: Fix buggy UDP transmission
    [23/37] Clean up duplicate includes in
    [2.6 patch] net/sunrpc/rpcb_clnt.c: make struct rpcb_program static
    SUNRPC: Use correct type in buffer length calculations
    SUNRPC: Fix default hostname created in rpc_create()
    nfs: add server port to rpc_pipe info file
    NFS: Get rid of some obsolete macros
    NFS: Simplify filehandle revalidation
    NFS: Ensure that nfs_link() returns a hashed dentry
    NFS: Be strict about dentry revalidation when doing exclusive create
    NFS: Don't zap the readdir caches upon error
    NFS: Remove the redundant nfs_reval_fsid()
    NFSv3: Always use directory post-op attributes in nfs3_proc_lookup
    ...

    Fix up trivial conflict due to sock_owned_by_user() cleanup manually in
    net/sunrpc/xprtsock.c

    Linus Torvalds
     

10 Oct, 2007

19 commits

  • This macro is only used in one place; in this place it seems simpler to
    put open-code it and move the comment to where it's used.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • The combination of S_ISGID bit set and S_IXGRP bit unset is used to mark the
    inode as "mandatory lockable" and there's a macro for this check called
    MANDATORY_LOCK(inode). However, fs/locks.c and some filesystems still perform
    the explicit i_mode checking. Besides, Andrew pointed out, that this macro is
    buggy itself, as it dereferences the inode arg twice.

    Convert this macro into static inline function and switch its users to it,
    making the code shorter and more readable.

    The __mandatory_lock() helper is to be used in places where the IS_MANDLOCK()
    for superblock is already known to be true.

    Signed-off-by: Pavel Emelyanov
    Cc: Trond Myklebust
    Cc: "J. Bruce Fields"
    Cc: David Howells
    Cc: Eric Van Hensbergen
    Cc: Ron Minnich
    Cc: Latchesar Ionkov
    Cc: Steven Whitehouse
    Signed-off-by: Andrew Morton

    Pavel Emelyanov
     
  • Without this we always return 2^32-1 as the the maximum namelength.

    Thanks to Andreas Gruenbacher for bug report and testing.

    Signed-off-by: J. Bruce Fields
    Cc: Andreas Gruenbacher

    J. Bruce Fields
     
  • It's not enough to take a reference on the delegation object itself; we
    need to ensure that the rpc_client won't go away just as we're about to
    make an rpc call.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • If a callback still holds a reference on the client, then it may be
    about to perform an rpc call, so it isn't safe to call rpc_shutdown().
    (Though rpc_shutdown() does wait for any outstanding rpc's, it can't
    know if a new rpc is about to be issued with that client.)

    So, wait to shutdown the rpc_client until the reference count on the
    client has gone to zero.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Currently there's a race that can cause an oops in generic_setlease.

    (In detail: nfsd, when it removes a lease, does so by calling
    vfs_setlease() with F_UNLCK and a pointer to the fl_flock field, which
    in turn points to nfsd's existing lease; but the first thing the
    setlease code does is call time_out_leases(). If the lease happens to
    already be beyond the lease break time, that will free the lease and (in
    nfsd's release_private callback) set fl_flock to NULL, leading to a NULL
    deference soon after in vfs_setlease().)

    There are probably other things to fix here too, but it seems inherently
    racy to allow either locks.c or nfsd to time out this lease. Instead
    just set the fl_break_time to 0 (preventing locks.c from ever timing out
    this lock) and leave it up to nfsd's laundromat thread to deal with it.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • 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: Peter Staubach
    Signed-off-by: J. Bruce Fields
    Acked-by: Neil Brown

    Peter Staubach
     
  • Each branch of this if-then-else has a bunch of duplicated code that we
    could just put at the end.

    Signed-off-by: "J. Bruce Fields"
    Acked-by: Neil Brown

    J. Bruce Fields
     
  • fs/nfsd/nfsctl.c: In function 'write_filehandle':
    fs/nfsd/nfsctl.c:301: warning: 'maxsize' may be used uninitialized in this function

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

    Andrew Morton
     
  • It doesn't make sense to make the callback with credentials that the
    client made the setclientid with. Instead the spec requires that the
    callback occur with the credentials the client authenticated *to*.
    It probably doesn't matter what we use for auth_unix, and some more
    infrastructure will be needed for auth_gss, so let's just remove the
    cred lookup for now.

    Signed-off-by: J. Bruce Fields
    Acked-by: Neil Brown

    J. Bruce Fields
     
  • We have some slabs that the nfs4 server uses to store state objects.
    We're currently creating and destroying those slabs whenever the server
    is brought up or down. That seems excessive; may as well just do that
    in module initialization and exit.

    Also add some minor header cleanup. (Thanks to Andrew Morton for that
    and a compile fix.)

    Signed-off-by: "J. Bruce Fields"
    Acked-by: Neil Brown

    J. Bruce Fields
     
  • We want to allow gss on the callback channel, so people using krb5 can
    still get the benefits of delegations.

    But looking up the rpc credential can take some time in that case. And
    we shouldn't delay the response to setclientid_confirm while we wait.

    It may be inefficient, but for now the simplest solution is just to
    spawn a new thread as necessary for the purpose.

    (Thanks to Adrian Bunk for catching a missing static here.)

    Signed-off-by: "J. Bruce Fields"
    Cc: Adrian Bunk

    J. Bruce Fields
     
  • Note that qword_get() returns length or -1, not an -ERROR.

    Signed-off-by: "J. Bruce Fields"
    Acked-by: Neil Brown

    J. Bruce Fields
     
  • To quote a recent mail from Andrew Morton:

    Look: if there's a way in which an unprivileged user can trigger
    a printk we fix it, end of story.

    OK. I assume that goes double for printk()s that might be triggered by
    random hosts on the internet. So, disable some printk()s that look like
    they could be triggered by malfunctioning or malicious clients. For
    now, just downgrade them to dprintk()s.

    Signed-off-by: "J. Bruce Fields"
    Acked-by: Neil Brown

    J. Bruce Fields
     
  • Benny Halevy suggested renaming cmp_* to same_* to make the meaning of
    the return value clearer.

    Fix some nearby style deviations while we're at it, including a small
    swath of creative indentation in nfs4_preprocess_seqid_op().

    Signed-off-by: "J. Bruce Fields"
    Acked-by: Neil Brown

    J. Bruce Fields
     
  • I moved this check into map_new_errors, but forgot to delete the
    original. Oops.

    Signed-off-by: "J. Bruce Fields"
    Acked-by: Neil Brown

    J. Bruce Fields
     
  • Signed-off-by: Christoph Hellwig
    Signed-off-by: J. Bruce Fields
    Acked-by: Neil Brown

    Christoph Hellwig
     
  • The nfserr_dropit happens routinely on upcalls (so a kmalloc failure is
    almost never the actual cause), but I occasionally get a complant from
    some tester that's worried because they ran across this message after
    turning on debugging to research some unrelated problem.

    Signed-off-by: "J. Bruce Fields"
    Acked-by: Neil Brown

    J. Bruce Fields
     
  • Due to recent edict to remove or replace printk's that can flood the system
    log.

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

    Chuck Lever
     

11 Sep, 2007

2 commits

  • fsid_source decided where to get the 'fsid' number to
    return for a GETATTR based on the type of filehandle.
    It can be from the device, from the fsid, or from the
    UUID.

    It is possible for the filehandle to be inconsistent
    with the export information, so make sure the export information
    actually has the info implied by the value returned by
    fsid_source.

    Signed-off-by: Neil Brown
    Cc: "Luiz Fernando N. Capitulino"
    Signed-off-by: "J. Bruce Fields"
    Signed-off-by: Linus Torvalds

    Neil Brown
     
  • Recent changes in NFSd cause a directory which is mounted-on
    to not appear properly when the filesystem containing it is exported.

    *exp_get* now returns -ENOENT rather than NULL and when
    commit 5d3dbbeaf56d0365ac6b5c0a0da0bd31cc4781e1
    removed the NULL checks, it didn't add a check for -ENOENT.

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

    Neil Brown
     

01 Aug, 2007

3 commits

  • 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
     
  • We shouldn't be using negative uid's and gid's in the idmap upcalls.

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

    J. Bruce Fields
     
  • RFC 3530 says:

    If the server uses an attribute to store the exclusive create verifier, it
    will signify which attribute by setting the appropriate bit in the attribute
    mask that is returned in the results.

    Linux uses the atime and mtime to store the verifier, but sends a zeroed out
    bitmask back to the client. This patch makes sure that we set the correct
    bits in the bitmask in this situation.

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

    Jeff Layton
     

27 Jul, 2007

1 commit


22 Jul, 2007

1 commit


20 Jul, 2007

6 commits

  • Slab destructors were no longer supported after Christoph's
    c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
    BUGs for both slab and slub, and slob never supported them
    either.

    This rips out support for the dtor pointer from kmem_cache_create()
    completely and fixes up every single callsite in the kernel (there were
    about 224, not including the slab allocator definitions themselves,
    or the documentation references).

    Signed-off-by: Paul Mundt

    Paul Mundt
     
  • Share a little common code, reverse the arguments for consistency, drop the
    unnecessary "inline", and lowercase the name.

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

    J. Bruce Fields
     
  • EX_RDONLY is only called in one place; just put it there.

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

    J. Bruce Fields
     
  • We can now assume that rqst_exp_get_by_name() does not return NULL; so clean
    up some unnecessary checks.

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

    J. Bruce Fields
     
  • 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
     
  • The value of nperbucket calculated here is too small--we should be rounding up
    instead of down--with the result that the index j in the following loop can
    overflow the raparm_hash array. At least in my case, the next thing in memory
    turns out to be export_table, so the symptoms I see are crashes caused by the
    appearance of four zeroed-out export entries in the first bucket of the hash
    table of exports (which were actually entries in the readahead cache, a
    pointer to which had been written to the export table in this initialization
    code).

    It looks like the bug was probably introduced with commit
    fce1456a19f5c08b688c29f00ef90fdfa074c79b ("knfsd: make the readahead params
    cache SMP-friendly").

    Cc:
    Cc: Greg Banks
    Signed-off-by: "J. Bruce Fields"
    Acked-by: NeilBrown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     

19 Jul, 2007

1 commit

  • We've been using the convention that vfs_foo is the function that calls
    a filesystem-specific foo method if it exists, or falls back on a
    generic method if it doesn't; thus vfs_foo is what is called when some
    other part of the kernel (normally lockd or nfsd) wants to get a lock,
    whereas foo is what filesystems call to use the underlying local
    functionality as part of their lock implementation.

    So rename setlease to vfs_setlease (which will call a
    filesystem-specific setlease after a later patch) and __setlease to
    setlease.

    Also, vfs_setlease need only be GPL-exported as long as it's only needed
    by lockd and nfsd.

    Signed-off-by: "J. Bruce Fields"

    J. Bruce Fields
     

18 Jul, 2007

4 commits

  • Allow root squashing to vary per-pseudoflavor, so that you can (for example)
    allow root access only when sufficiently strong security is in use.

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

    J. Bruce Fields
     
  • 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
     
  • We could return some sort of error in the case where someone asks for secinfo
    on an export without the secinfo= option set--that'd be no worse than what
    we've been doing. But it's not really correct. So, hack up an approximate
    secinfo response in that case--it may not be complete, but it'll tell the
    client at least one acceptable security 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
     
  • Implement the secinfo operation.

    (Thanks to Usha Ketineni wrote an earlier version of this support.)

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

    Andy Adamson