01 Mar, 2013

1 commit

  • Pull nfsd changes from J Bruce Fields:
    "Miscellaneous bugfixes, plus:

    - An overhaul of the DRC cache by Jeff Layton. The main effect is
    just to make it larger. This decreases the chances of intermittent
    errors especially in the UDP case. But we'll need to watch for any
    reports of performance regressions.

    - Containerized nfsd: with some limitations, we now support
    per-container nfs-service, thanks to extensive work from Stanislav
    Kinsbursky over the last year."

    Some notes about conflicts, since there were *two* non-data semantic
    conflicts here:

    - idr_remove_all() had been added by a memory leak fix, but has since
    become deprecated since idr_destroy() does it for us now.

    - xs_local_connect() had been added by this branch to make AF_LOCAL
    connections be synchronous, but in the meantime Trond had changed the
    calling convention in order to avoid a RCU dereference.

    There were a couple of more obvious actual source-level conflicts due to
    the hlist traversal changes and one just due to code changes next to
    each other, but those were trivial.

    * 'for-3.9' of git://linux-nfs.org/~bfields/linux: (49 commits)
    SUNRPC: make AF_LOCAL connect synchronous
    nfsd: fix compiler warning about ambiguous types in nfsd_cache_csum
    svcrpc: fix rpc server shutdown races
    svcrpc: make svc_age_temp_xprts enqueue under sv_lock
    lockd: nlmclnt_reclaim(): avoid stack overflow
    nfsd: enable NFSv4 state in containers
    nfsd: disable usermode helper client tracker in container
    nfsd: use proper net while reading "exports" file
    nfsd: containerize NFSd filesystem
    nfsd: fix comments on nfsd_cache_lookup
    SUNRPC: move cache_detail->cache_request callback call to cache_read()
    SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function
    SUNRPC: rework cache upcall logic
    SUNRPC: introduce cache_detail->cache_request callback
    NFS: simplify and clean cache library
    NFS: use SUNRPC cache creation and destruction helper for DNS cache
    nfsd4: free_stid can be static
    nfsd: keep a checksum of the first 256 bytes of request
    sunrpc: trim off trailing checksum before returning decrypted or integrity authenticated buffer
    sunrpc: fix comment in struct xdr_buf definition
    ...

    Linus Torvalds
     

15 Feb, 2013

2 commits

  • For most of SUNRPC caches (except NFS DNS cache) cache_detail->cache_upcall is
    redundant since all that it's implementations are doing is calling
    sunrpc_cache_pipe_upcall() with proper function address argument.
    Cache request function address is now stored on cache_detail structure and
    thus all the code can be simplified.
    Now, for those cache details, which doesn't have cache_upcall callback (the
    only one, which still has is nfs_dns_resolve_template)
    sunrpc_cache_pipe_upcall will be called instead.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     
  • This callback will allow to simplify upcalls in further patches in this
    series.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: J. Bruce Fields

    Stanislav Kinsbursky
     

13 Feb, 2013

6 commits

  • When reading kuids from the wire map them into the initial user
    namespace, and validate the mapping succeded.

    When reading kgids from the wire map them into the initial user
    namespace, and validate the mapping succeded.

    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • When a new rpc connection is established with an in-kernel server, the
    traffic passes through svc_process_common, and svc_set_client and down
    into svcauth_unix_set_client if it is of type RPC_AUTH_NULL or
    RPC_AUTH_UNIX.

    svcauth_unix_set_client then looks at the uid of the credential we
    have assigned to the incomming client and if we don't have the groups
    already cached makes an upcall to get a list of groups that the client
    can use.

    The upcall encodes send a rpc message to user space encoding the uid
    of the user whose groups we want to know. Encode the kuid of the user
    in the initial user namespace as nfs mounts can only happen today in
    the initial user namespace.

    When a reply to an upcall comes in convert interpret the uid and gid values
    from the rpc pipe as uids and gids in the initial user namespace and convert
    them into kuids and kgids before processing them further.

    When reading proc files listing the uid to gid list cache convert the
    kuids and kgids from into uids and gids the initial user namespace. As we are
    displaying server internal details it makes sense to display these values
    from the servers perspective.

    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • In svcauth_unix introduce a helper unix_gid_hash as otherwise the
    expresion to generate the hash value is just too long.

    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • When comparing uids use uid_eq instead of ==.
    When comparing gids use gid_eq instead of ==.

    And unfortunate cost of type safety.

    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • Convert variables that store uids and gids to be of type
    kuid_t and kgid_t instead of type uid_t and gid_t.

    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • Instead of (uid_t)0 use GLOBAL_ROOT_UID.
    Instead of (gid_t)0 use GLOBAL_ROOT_GID.
    Instead of (uid_t)-1 use INVALID_UID
    Instead of (gid_t)-1 use INVALID_GID.
    Instead of NOGROUP use INVALID_GID.

    Cc: "J. Bruce Fields"
    Cc: Trond Myklebust
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

05 Feb, 2013

1 commit


19 Jul, 2012

1 commit

  • Introduce ipv6_addr_hash() helper doing a XOR on all bits
    of an IPv6 address, with an optimized x86_64 version.

    Use it in flow dissector, as suggested by Andrew McGregor,
    to reduce hash collision probabilities in fq_codel (and other
    users of flow dissector)

    Use it in ip6_tunnel.c and use more bit shuffling, as suggested
    by David Laight, as existing hash was ignoring most of them.

    Use it in sunrpc and use more bit shuffling, using hash_32().

    Use it in net/ipv6/addrconf.c, using hash_32() as well.

    As a cleanup, use it in net/ipv4/tcp_metrics.c

    Signed-off-by: Eric Dumazet
    Reported-by: Andrew McGregor
    Cc: Dave Taht
    Cc: Tom Herbert
    Cc: David Laight
    Cc: Joe Perches
    Signed-off-by: David S. Miller

    Eric Dumazet
     

01 Jun, 2012

4 commits

  • Pull the rest of the nfsd commits from Bruce Fields:
    "... and then I cherry-picked the remainder of the patches from the
    head of my previous branch"

    This is the rest of the original nfsd branch, rebased without the
    delegation stuff that I thought really needed to be redone.

    I don't like rebasing things like this in general, but in this situation
    this was the lesser of two evils.

    * 'for-3.5' of git://linux-nfs.org/~bfields/linux: (50 commits)
    nfsd4: fix, consolidate client_has_state
    nfsd4: don't remove rebooted client record until confirmation
    nfsd4: remove some dprintk's and a comment
    nfsd4: return "real" sequence id in confirmed case
    nfsd4: fix exchange_id to return confirm flag
    nfsd4: clarify that renewing expired client is a bug
    nfsd4: simpler ordering of setclientid_confirm checks
    nfsd4: setclientid: remove pointless assignment
    nfsd4: fix error return in non-matching-creds case
    nfsd4: fix setclientid_confirm same_cred check
    nfsd4: merge 3 setclientid cases to 2
    nfsd4: pull out common code from setclientid cases
    nfsd4: merge last two setclientid cases
    nfsd4: setclientid/confirm comment cleanup
    nfsd4: setclientid remove unnecessary terms from a logical expression
    nfsd4: move rq_flavor into svc_cred
    nfsd4: stricter cred comparison for setclientid/exchange_id
    nfsd4: move principal name into svc_cred
    nfsd4: allow removing clients not holding state
    nfsd4: rearrange exchange_id logic to simplify
    ...

    Linus Torvalds
     
  • Pull nfsd update from Bruce Fields.

    * 'for-3.5-take-2' of git://linux-nfs.org/~bfields/linux: (23 commits)
    nfsd: trivial: use SEEK_SET instead of 0 in vfs_llseek
    SUNRPC: split upcall function to extract reusable parts
    nfsd: allocate id-to-name and name-to-id caches in per-net operations.
    nfsd: make name-to-id cache allocated per network namespace context
    nfsd: make id-to-name cache allocated per network namespace context
    nfsd: pass network context to idmap init/exit functions
    nfsd: allocate export and expkey caches in per-net operations.
    nfsd: make expkey cache allocated per network namespace context
    nfsd: make export cache allocated per network namespace context
    nfsd: pass pointer to export cache down to stack wherever possible.
    nfsd: pass network context to export caches init/shutdown routines
    Lockd: pass network namespace to creation and destruction routines
    NFSd: remove hard-coded dereferences to name-to-id and id-to-name caches
    nfsd: pass pointer to expkey cache down to stack wherever possible.
    nfsd: use hash table from cache detail in nfsd export seq ops
    nfsd: pass svc_export_cache pointer as private data to "exports" seq file ops
    nfsd: use exp_put() for svc_export_cache put
    nfsd: use cache detail pointer from svc_export structure on cache put
    nfsd: add link to owner cache detail to svc_export structure
    nfsd: use passed cache_detail pointer expkey_parse()
    ...

    Linus Torvalds
     
  • Move the rq_flavor into struct svc_cred, and use it in setclientid and
    exchange_id comparisons as well.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Instead of keeping the principal name associated with a request in a
    structure that's private to auth_gss and using an accessor function,
    move it to svc_cred.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

03 May, 2012

1 commit


12 Apr, 2012

1 commit


26 Mar, 2012

1 commit


04 Feb, 2012

1 commit


01 Feb, 2012

3 commits


12 Dec, 2011

1 commit


23 Nov, 2011

1 commit


16 Jul, 2011

2 commits

  • Like svcauth_unix, the symbol svcauth_null is used external from this
    file. Declare it as extern to quiet the following sparse noise:

    warning: symbol 'svcauth_null' was not declared. Should it be static?

    Signed-off-by: H Hartley Sweeten
    Cc: Trond Myklebust
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Cc: "David S. Miller"
    Signed-off-by: J. Bruce Fields

    H Hartley Sweeten
     
  • As promised in feature-removal-schedule.txt it is time to
    remove the nfsctl system call.

    Userspace has perferred to not use this call throughout 2.6 and it has been
    excluded in the default configuration since 2.6.36 (9 months ago).

    So this patch removes all the code that was being compiled out.

    There are still references to sys_nfsctl in various arch systemcall tables
    and related code. These should be cleaned out too, probably in the next
    merge window.

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

    NeilBrown
     

10 Mar, 2011

1 commit

  • "After merging the nfsd tree, today's linux-next build (powerpc
    ppc64_defconfig) produced this warning:

    net/sunrpc/svcauth_unix.c: In function 'unix_domain_find':
    net/sunrpc/svcauth_unix.c:58: warning: passing argument 1 of
    +'svcauth_unix_domain_release' from incompatible pointer type
    net/sunrpc/svcauth_unix.c:41: note: expected 'struct auth_domain *' but
    argument
    +is of type 'struct unix_domain *'

    Introduced by commit 8b3e07ac908d ("svcrpc: fix rare race on unix_domain
    creation")."

    Reported-by: Stephen Rothwell
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

09 Mar, 2011

1 commit

  • Note that "new" here is not yet fully initialized; auth_domain_put
    should be called only on auth_domains that have actually been added to
    the hash.

    Before this fix, two attempts to add the same domain at once could
    cause the hlist_del in auth_domain_put to fail.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

05 Jan, 2011

2 commits


18 Dec, 2010

1 commit


12 Oct, 2010

1 commit


27 Sep, 2010

5 commits


22 Sep, 2010

1 commit

  • If we drop a request in the sunrpc layer, either due kmalloc failure,
    or due to a cache miss when we could not queue the request for later
    replay, then close the connection to encourage the client to retry sooner.

    Note that if the drop happens in the NFS layer, NFSERR_JUKEBOX
    (aka NFS4ERR_DELAY) is returned to guide the client concerning
    replay.

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

    NeilBrown
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

03 Mar, 2010

1 commit