13 Sep, 2013

2 commits

  • Pull vfs pile 4 from Al Viro:
    "list_lru pile, mostly"

    This came out of Andrew's pile, Al ended up doing the merge work so that
    Andrew didn't have to.

    Additionally, a few fixes.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (42 commits)
    super: fix for destroy lrus
    list_lru: dynamically adjust node arrays
    shrinker: Kill old ->shrink API.
    shrinker: convert remaining shrinkers to count/scan API
    staging/lustre/libcfs: cleanup linux-mem.h
    staging/lustre/ptlrpc: convert to new shrinker API
    staging/lustre/obdclass: convert lu_object shrinker to count/scan API
    staging/lustre/ldlm: convert to shrinkers to count/scan API
    hugepage: convert huge zero page shrinker to new shrinker API
    i915: bail out earlier when shrinker cannot acquire mutex
    drivers: convert shrinkers to new count/scan API
    fs: convert fs shrinkers to new scan/count API
    xfs: fix dquot isolation hang
    xfs-convert-dquot-cache-lru-to-list_lru-fix
    xfs: convert dquot cache lru to list_lru
    xfs: rework buffer dispose list tracking
    xfs-convert-buftarg-lru-to-generic-code-fix
    xfs: convert buftarg LRU to generic code
    fs: convert inode and dentry shrinking to be node aware
    vmscan: per-node deferred work
    ...

    Linus Torvalds
     
  • Pull NFS client bugfixes (part 2) from Trond Myklebust:
    "Bugfixes:
    - Fix a few credential reference leaks resulting from the
    SP4_MACH_CRED NFSv4.1 state protection code.
    - Fix the SUNRPC bloatometer footprint: convert a 256K hashtable into
    the intended 64 byte structure.
    - Fix a long standing XDR issue with FREE_STATEID
    - Fix a potential WARN_ON spamming issue
    - Fix a missing dprintk() kuid conversion

    New features:
    - Enable the NFSv4.1 state protection support for the WRITE and
    COMMIT operations"

    * tag 'nfs-for-3.12-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    SUNRPC: No, I did not intend to create a 256KiB hashtable
    sunrpc: Add missing kuids conversion for printing
    NFSv4.1: sp4_mach_cred: WARN_ON -> WARN_ON_ONCE
    NFSv4.1: sp4_mach_cred: no need to ref count creds
    NFSv4.1: fix SECINFO* use of put_rpccred
    NFSv4.1: sp4_mach_cred: ask for WRITE and COMMIT
    NFSv4.1 fix decode_free_stateid

    Linus Torvalds
     

12 Sep, 2013

2 commits


11 Sep, 2013

2 commits

  • Pull nfsd updates from Bruce Fields:
    "This was a very quiet cycle! Just a few bugfixes and some cleanup"

    * 'nfsd-next' of git://linux-nfs.org/~bfields/linux:
    rpc: let xdr layer allocate gssproxy receieve pages
    rpc: fix huge kmalloc's in gss-proxy
    rpc: comment on linux_cred encoding, treat all as unsigned
    rpc: clean up decoding of gssproxy linux creds
    svcrpc: remove unused rq_resused
    nfsd4: nfsd4_create_clid_dir prints uninitialized data
    nfsd4: fix leak of inode reference on delegation failure
    Revert "nfsd: nfs4_file_get_access: need to be more careful with O_RDWR"
    sunrpc: prepare NFS for 2038
    nfsd4: fix setlease error return
    nfsd: nfs4_file_get_access: need to be more careful with O_RDWR

    Linus Torvalds
     
  • Convert the remaining couple of random shrinkers in the tree to the new
    API.

    Signed-off-by: Dave Chinner
    Signed-off-by: Glauber Costa
    Cc: Marcelo Tosatti
    Cc: Gleb Natapov
    Cc: Chuck Lever
    Cc: J. Bruce Fields
    Cc: Trond Myklebust
    Cc: "Theodore Ts'o"
    Cc: Adrian Hunter
    Cc: Al Viro
    Cc: Artem Bityutskiy
    Cc: Arve Hjønnevåg
    Cc: Carlos Maiolino
    Cc: Christoph Hellwig
    Cc: Chuck Lever
    Cc: Daniel Vetter
    Cc: David Rientjes
    Cc: Gleb Natapov
    Cc: Greg Thelen
    Cc: J. Bruce Fields
    Cc: Jan Kara
    Cc: Jerome Glisse
    Cc: John Stultz
    Cc: KAMEZAWA Hiroyuki
    Cc: Kent Overstreet
    Cc: Kirill A. Shutemov
    Cc: Marcelo Tosatti
    Cc: Mel Gorman
    Cc: Steven Whitehouse
    Cc: Thomas Hellstrom
    Cc: Trond Myklebust
    Signed-off-by: Andrew Morton
    Signed-off-by: Al Viro

    Dave Chinner
     

10 Sep, 2013

1 commit

  • Pull NFS client updates from Trond Myklebust:
    "Highlights include:

    - Fix NFSv4 recovery so that it doesn't recover lost locks in cases
    such as lease loss due to a network partition, where doing so may
    result in data corruption. Add a kernel parameter to control
    choice of legacy behaviour or not.
    - Performance improvements when 2 processes are writing to the same
    file.
    - Flush data to disk when an RPCSEC_GSS session timeout is imminent.
    - Implement NFSv4.1 SP4_MACH_CRED state protection to prevent other
    NFS clients from being able to manipulate our lease and file
    locking state.
    - Allow sharing of RPCSEC_GSS caches between different rpc clients.
    - Fix the broken NFSv4 security auto-negotiation between client and
    server.
    - Fix rmdir() to wait for outstanding sillyrename unlinks to complete
    - Add a tracepoint framework for debugging NFSv4 state recovery
    issues.
    - Add tracing to the generic NFS layer.
    - Add tracing for the SUNRPC socket connection state.
    - Clean up the rpc_pipefs mount/umount event management.
    - Merge more patches from Chuck in preparation for NFSv4 migration
    support"

    * tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (107 commits)
    NFSv4: use mach cred for SECINFO_NO_NAME w/ integrity
    NFS: nfs_compare_super shouldn't check the auth flavour unless 'sec=' was set
    NFSv4: Allow security autonegotiation for submounts
    NFSv4: Disallow security negotiation for lookups when 'sec=' is specified
    NFSv4: Fix security auto-negotiation
    NFS: Clean up nfs_parse_security_flavors()
    NFS: Clean up the auth flavour array mess
    NFSv4.1 Use MDS auth flavor for data server connection
    NFS: Don't check lock owner compatability unless file is locked (part 2)
    NFS: Don't check lock owner compatibility in writes unless file is locked
    nfs4: Map NFS4ERR_WRONG_CRED to EPERM
    nfs4.1: Add SP4_MACH_CRED write and commit support
    nfs4.1: Add SP4_MACH_CRED stateid support
    nfs4.1: Add SP4_MACH_CRED secinfo support
    nfs4.1: Add SP4_MACH_CRED cleanup support
    nfs4.1: Add state protection handler
    nfs4.1: Minimal SP4_MACH_CRED implementation
    SUNRPC: Replace pointer values with task->tk_pid and rpc_clnt->cl_clid
    SUNRPC: Add an identifier for struct rpc_clnt
    SUNRPC: Ensure rpc_task->tk_pid is available for tracepoints
    ...

    Linus Torvalds
     

06 Sep, 2013

5 commits

  • In theory the linux cred in a gssproxy reply can include up to
    NGROUPS_MAX data, 256K of data. In the common case we expect it to be
    shorter. So do as the nfsv3 ACL code does and let the xdr code allocate
    the pages as they come in, instead of allocating a lot of pages that
    won't typically be used.

    Tested-by: Simo Sorce
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • The reply to a gssproxy can include up to NGROUPS_MAX gid's, which will
    take up more than a page. We therefore need to allocate an array of
    pages to hold the reply instead of trying to allocate a single huge
    buffer.

    Tested-by: Simo Sorce
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • The encoding of linux creds is a bit confusing.

    Also: I think in practice it doesn't really matter whether we treat any
    of these things as signed or unsigned, but unsigned seems more
    straightforward: uid_t/gid_t are unsigned and it simplifies the ngroups
    overflow check.

    Tested-by: Simo Sorce
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • We can use the normal coding infrastructure here.

    Two minor behavior changes:

    - we're assuming no wasted space at the end of the linux cred.
    That seems to match gss-proxy's behavior, and I can't see why
    it would need to do differently in the future.

    - NGROUPS_MAX check added: note groups_alloc doesn't do this,
    this is the caller's responsibility.

    Tested-by: Simo Sorce
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Conflicts:
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    net/bridge/br_multicast.c
    net/ipv6/sit.c

    The conflicts were minor:

    1) sit.c changes overlap with change to ip_tunnel_xmit() signature.

    2) br_multicast.c had an overlap between computing max_delay using
    msecs_to_jiffies and turning MLDV2_MRC() into an inline function
    with a name using lowercase instead of uppercase letters.

    3) stmmac had two overlapping changes, one which conditionally allocated
    and hooked up a dma_cfg based upon the presence of the pbl OF property,
    and another one handling store-and-forward DMA made. The latter of
    which should not go into the new of_find_property() basic block.

    Signed-off-by: David S. Miller

    David S. Miller
     

05 Sep, 2013

3 commits


04 Sep, 2013

3 commits

  • Most of the time an error from the credops crvalidate function means the
    server has sent us a garbage verifier. The gss_validate function is the
    exception where there is an -EACCES case if the user GSS_context on the client
    has expired.

    Signed-off-by: Andy Adamson
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • This patch provides the RPC layer helper functions to allow NFS to manage
    data in the face of expired credentials - such as avoiding buffered WRITEs
    and COMMITs when the gss context will expire before the WRITEs are flushed
    and COMMITs are sent.

    These helper functions enable checking the expiration of an underlying
    credential key for a generic rpc credential, e.g. the gss_cred gss context
    gc_expiry which for Kerberos is set to the remaining TGT lifetime.

    A new rpc_authops key_timeout is only defined for the generic auth.
    A new rpc_credops crkey_to_expire is only defined for the generic cred.
    A new rpc_credops crkey_timeout is only defined for the gss cred.

    Set a credential key expiry watermark, RPC_KEY_EXPIRE_TIMEO set to 240 seconds
    as a default and can be set via a module parameter as we need to ensure there
    is time for any dirty data to be flushed.

    If key_timeout is called on a credential with an underlying credential key that
    will expire within watermark seconds, we set the RPC_CRED_KEY_EXPIRE_SOON
    flag in the generic_cred acred so that the NFS layer can clean up prior to
    key expiration.

    Checking a generic credential's underlying credential involves a cred lookup.
    To avoid this lookup in the normal case when the underlying credential has
    a key that is valid (before the watermark), a notify flag is set in
    the generic credential the first time the key_timeout is called. The
    generic credential then stops checking the underlying credential key expiry, and
    the underlying credential (gss_cred) match routine then checks the key
    expiration upon each normal use and sets a flag in the associated generic
    credential only when the key expiration is within the watermark.
    This in turn signals the generic credential key_timeout to perform the extra
    credential lookup thereafter.

    Signed-off-by: Andy Adamson
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • The NFS layer needs to know when a key has expired.
    This change also returns -EKEYEXPIRED to the application, and the informative
    "Key has expired" error message is displayed. The user then knows that
    credential renewal is required.

    Signed-off-by: Andy Adamson
    Signed-off-by: Trond Myklebust

    Andy Adamson
     

03 Sep, 2013

2 commits


01 Sep, 2013

5 commits


30 Aug, 2013

8 commits


29 Aug, 2013

1 commit

  • Some architectures, such as ARM-32 do not return the same base address
    when you call kmap_atomic() twice on the same page.
    This causes problems for the memmove() call in the XDR helper routine
    "_shift_data_right_pages()", since it defeats the detection of
    overlapping memory ranges, and has been seen to corrupt memory.

    The fix is to distinguish between the case where we're doing an
    inter-page copy or not. In the former case of we know that the memory
    ranges cannot possibly overlap, so we can additionally micro-optimise
    by replacing memmove() with memcpy().

    Reported-by: Mark Young
    Reported-by: Matt Craighead
    Cc: Bruce Fields
    Cc: stable@vger.kernel.org
    Signed-off-by: Trond Myklebust
    Tested-by: Matt Craighead

    Trond Myklebust
     

17 Aug, 2013

1 commit


08 Aug, 2013

1 commit

  • If rpcbind causes our connection to the AF_LOCAL socket to close after
    we've registered a service, then we want to be careful about reconnecting
    since the mount namespace may have changed.

    By simply refusing to reconnect the AF_LOCAL socket in the case of
    unregister, we avoid the need to somehow save the mount namespace. While
    this may lead to some services not unregistering properly, it should
    be safe.

    Signed-off-by: Trond Myklebust
    Cc: Nix
    Cc: Jeff Layton
    Cc: stable@vger.kernel.org # 3.9.x

    Trond Myklebust
     

06 Aug, 2013

1 commit


04 Aug, 2013

1 commit


01 Aug, 2013

2 commits