17 Oct, 2012

1 commit

  • Remove non-UAPI Kbuild files that have become empty as a result of UAPI
    disintegration. They used to have only header-y lines in them and those have
    now moved to the Kbuild files in the corresponding uapi/ directories.

    Possibly these should not be removed but rather have a comment inserted to say
    they are intentionally left blank. This would make it easier to add generated
    header lines in future without having to restore the infrastructure.

    Note that at this point not all the UAPI disintegration parts have been merged,
    so it is likely that more empty Kbuild files will turn up.

    It is probably necessary to make the files non-empty to prevent the patch
    program from automatically deleting them when it reduces them to nothing.

    Signed-off-by: David Howells

    David Howells
     

13 Oct, 2012

1 commit

  • Pull nfsd update from J Bruce Fields:
    "Another relatively quiet cycle. There was some progress on my
    remaining 4.1 todo's, but a couple of them were just of the form
    "check that we do X correctly", so didn't have much affect on the
    code.

    Other than that, a bunch of cleanup and some bugfixes (including an
    annoying NFSv4.0 state leak and a busy-loop in the server that could
    cause it to peg the CPU without making progress)."

    * 'for-3.7' of git://linux-nfs.org/~bfields/linux: (46 commits)
    UAPI: (Scripted) Disintegrate include/linux/sunrpc
    UAPI: (Scripted) Disintegrate include/linux/nfsd
    nfsd4: don't allow reclaims of expired clients
    nfsd4: remove redundant callback probe
    nfsd4: expire old client earlier
    nfsd4: separate session allocation and initialization
    nfsd4: clean up session allocation
    nfsd4: minor free_session cleanup
    nfsd4: new_conn_from_crses should only allocate
    nfsd4: separate connection allocation and initialization
    nfsd4: reject bad forechannel attrs earlier
    nfsd4: enforce per-client sessions/no-sessions distinction
    nfsd4: set cl_minorversion at create time
    nfsd4: don't pin clientids to pseudoflavors
    nfsd4: fix bind_conn_to_session xdr comment
    nfsd4: cast readlink() bug argument
    NFSD: pass null terminated buf to kstrtouint()
    nfsd: remove duplicate init in nfsd4_cb_recall
    nfsd4: eliminate redundant nfs4_free_stateid
    fs/nfsd/nfs4idmap.c: adjust inconsistent IS_ERR and PTR_ERR
    ...

    Linus Torvalds
     

10 Oct, 2012

1 commit

  • This is to complete part of the Userspace API (UAPI) disintegration for which
    the preparatory patches were pulled recently. After these patches, userspace
    headers will be segregated into:

    include/uapi/linux/.../foo.h

    for the userspace interface stuff, and:

    include/linux/.../foo.h

    for the strictly kernel internal stuff.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

09 Oct, 2012

1 commit


02 Oct, 2012

1 commit

  • An ULP is supposed to be able to replace a GSS rpc_auth object with
    another GSS rpc_auth object using rpcauth_create(). However,
    rpcauth_create() in 3.5 reliably fails with -EEXIST in this case.
    This is because when gss_create() attempts to create the upcall pipes,
    sometimes they are already there. For example if a pipe FS mount
    event occurs, or a previous GSS flavor was in use for this rpc_clnt.

    It turns out that's not the only problem here. While working on a
    fix for the above problem, we noticed that replacing an rpc_clnt's
    rpc_auth is not safe, since dereferencing the cl_auth field is not
    protected in any way.

    So we're deprecating the ability of rpcauth_create() to switch an
    rpc_clnt's security flavor during normal operation. Instead, let's
    add a fresh API that clones an rpc_clnt and gives the clone a new
    flavor before it's used.

    This makes immediate use of the new __rpc_clone_client() helper.

    This can be used in a similar fashion to rpcauth_create() when a
    client is hunting for the correct security flavor. Instead of
    replacing an rpc_clnt's security flavor in a loop, the ULP replaces
    the whole rpc_clnt.

    To fix the -EEXIST problem, any ULP logic that relies on replacing
    an rpc_clnt's rpc_auth with rpcauth_create() must be changed to use
    this API instead.

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

    Chuck Lever
     

29 Sep, 2012

1 commit


10 Sep, 2012

1 commit

  • You can use nfsd/portlist to give nfsd additional sockets to listen on.
    In theory you can also remove listening sockets this way. But nobody's
    ever done that as far as I can tell.

    Also this was partially broken in 2.6.25, by
    a217813f9067b785241cb7f31956e51d2071703a "knfsd: Support adding
    transports by writing portlist file".

    (Note that we decide whether to take the "delfd" case by checking for a
    digit--but what's actually expected in that case is something made by
    svc_one_sock_name(), which won't begin with a digit.)

    So, let's just rip out this stuff.

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

    J. Bruce Fields
     

07 Sep, 2012

1 commit

  • Commit 43cedbf0e8dfb9c5610eb7985d5f21263e313802 (SUNRPC: Ensure that
    we grab the XPRT_LOCK before calling xprt_alloc_slot) is causing
    hangs in the case of NFS over UDP mounts.

    Since neither the UDP or the RDMA transport mechanism use dynamic slot
    allocation, we can skip grabbing the socket lock for those transports.
    Add a new rpc_xprt_op to allow switching between the TCP and UDP/RDMA
    case.

    Note that the NFSv4.1 back channel assigns the slot directly
    through rpc_run_bc_task, so we can ignore that case.

    Reported-by: Dick Streefland
    Signed-off-by: Trond Myklebust
    Cc: stable@vger.kernel.org [>= 3.1]

    Trond Myklebust
     

22 Aug, 2012

3 commits


01 Aug, 2012

3 commits

  • Merge Andrew's second set of patches:
    - MM
    - a few random fixes
    - a couple of RTC leftovers

    * emailed patches from Andrew Morton : (120 commits)
    rtc/rtc-88pm80x: remove unneed devm_kfree
    rtc/rtc-88pm80x: assign ret only when rtc_register_driver fails
    mm: hugetlbfs: close race during teardown of hugetlbfs shared page tables
    tmpfs: distribute interleave better across nodes
    mm: remove redundant initialization
    mm: warn if pg_data_t isn't initialized with zero
    mips: zero out pg_data_t when it's allocated
    memcg: gix memory accounting scalability in shrink_page_list
    mm/sparse: remove index_init_lock
    mm/sparse: more checks on mem_section number
    mm/sparse: optimize sparse_index_alloc
    memcg: add mem_cgroup_from_css() helper
    memcg: further prevent OOM with too many dirty pages
    memcg: prevent OOM with too many dirty pages
    mm: mmu_notifier: fix freed page still mapped in secondary MMU
    mm: memcg: only check anon swapin page charges for swap cache
    mm: memcg: only check swap cache pages for repeated charging
    mm: memcg: split swapin charge function into private and public part
    mm: memcg: remove needless !mm fixup to init_mm when charging
    mm: memcg: remove unneeded shmem charge type
    ...

    Linus Torvalds
     
  • Implement the new swapfile a_ops for NFS and hook up ->direct_IO. This
    will set the NFS socket to SOCK_MEMALLOC and run socket reconnect under
    PF_MEMALLOC as well as reset SOCK_MEMALLOC before engaging the protocol
    ->connect() method.

    PF_MEMALLOC should allow the allocation of struct socket and related
    objects and the early (re)setting of SOCK_MEMALLOC should allow us to
    receive the packets required for the TCP connection buildup.

    [jlayton@redhat.com: Restore PF_MEMALLOC task flags in all cases]
    [dfeng@redhat.com: Fix handling of multiple swap files]
    [a.p.zijlstra@chello.nl: Original patch]
    Signed-off-by: Mel Gorman
    Acked-by: Rik van Riel
    Cc: Christoph Hellwig
    Cc: David S. Miller
    Cc: Eric B Munson
    Cc: Eric Paris
    Cc: James Morris
    Cc: Mel Gorman
    Cc: Mike Christie
    Cc: Neil Brown
    Cc: Sebastian Andrzej Siewior
    Cc: Trond Myklebust
    Cc: Xiaotian Feng
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • Pull nfsd changes from J. Bruce Fields:
    "This has been an unusually quiet cycle--mostly bugfixes and cleanup.
    The one large piece is Stanislav's work to containerize the server's
    grace period--but that in itself is just one more step in a
    not-yet-complete project to allow fully containerized nfs service.

    There are a number of outstanding delegation, container, v4 state, and
    gss patches that aren't quite ready yet; 3.7 may be wilder."

    * 'nfsd-next' of git://linux-nfs.org/~bfields/linux: (35 commits)
    NFSd: make boot_time variable per network namespace
    NFSd: make grace end flag per network namespace
    Lockd: move grace period management from lockd() to per-net functions
    LockD: pass actual network namespace to grace period management functions
    LockD: manage grace list per network namespace
    SUNRPC: service request network namespace helper introduced
    NFSd: make nfsd4_manager allocated per network namespace context.
    LockD: make lockd manager allocated per network namespace
    LockD: manage grace period per network namespace
    Lockd: add more debug to host shutdown functions
    Lockd: host complaining function introduced
    LockD: manage used host count per networks namespace
    LockD: manage garbage collection timeout per networks namespace
    LockD: make garbage collector network namespace aware.
    LockD: mark host per network namespace on garbage collect
    nfsd4: fix missing fault_inject.h include
    locks: move lease-specific code out of locks_delete_lock
    locks: prevent side-effects of locks_release_private before file_lock is initialized
    NFSd: set nfsd_serv to NULL after service destruction
    NFSd: introduce nfsd_destroy() helper
    ...

    Linus Torvalds
     

28 Jul, 2012

1 commit


25 Jul, 2012

1 commit


17 Jul, 2012

1 commit

  • The gss_mech_list_pseudoflavors() function provides a list of
    currently registered GSS pseudoflavors. This list does not include
    any non-GSS flavors that have been registered with the RPC client.
    nfs4_find_root_sec() currently adds these extra flavors by hand.

    Instead, nfs4_find_root_sec() should be looking at the set of flavors
    that have been explicitly registered via rpcauth_register(). And,
    other areas of code will soon need the same kind of list that
    contains all flavors the kernel currently knows about (see below).

    Rather than cloning the open-coded logic in nfs4_find_root_sec() to
    those new places, introduce a generic RPC function that generates a
    full list of registered auth flavors and pseudoflavors.

    A new rpc_authops method is added that lists a flavor's
    pseudoflavors, if it has any. I encountered an interesting module
    loader loop when I tried to get the RPC client to invoke
    gss_mech_list_pseudoflavors() by name.

    This patch is a pre-requisite for server trunking discovery, and a
    pre-requisite for fixing up the in-kernel mount client to do better
    automatic security flavor selection.

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

    Chuck Lever
     

12 Jul, 2012

2 commits

  • This patch replaces the usage of simple_strtoul with kstrtoint in
    get_int(), since the simple_str* family doesn't account for overflow
    and is deprecated.
    Also, in this specific case, the long from strtol is silently converted
    to an int by the caller.

    As Joe Perches suggested, this patch also removes
    the redundant temporary variable rv, since kstrtoint() will not write to
    anint unless it's successful.

    Cc: Joe Perches
    Signed-off-by: Eldad Zack
    Signed-off-by: J. Bruce Fields

    Eldad Zack
     
  • Neaten code style in get_int().
    Also use sizeof() instead of hard coded number as suggested by
    Joe Perches .

    Cc: Joe Perches
    Signed-off-by: Eldad Zack
    Signed-off-by: J. Bruce Fields

    Eldad Zack
     

29 Jun, 2012

4 commits


01 Jun, 2012

3 commits


12 Apr, 2012

2 commits


26 Mar, 2012

1 commit


21 Mar, 2012

2 commits

  • Loads of these:

    linux/net/sunrpc/rpcb_clnt.c:942:2: warning: suggest braces around
    empty body in ‘do’ statement [-Wempty-body]

    show up when I unset CONFIG_PROC_SYSCTL. Seen with

    gcc (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9)

    Reported-by: Andrew Morton
    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • This allows us to turn on/off the dprintk() debugging interfaces for
    those distributions that don't ship the 'rpcdebug' utility.
    It also allows us to add Kbuild dependencies. Specifically, we already
    know that dprintk() in general relies on CONFIG_SYSCTL. Now it turns out
    that the NFS dprintks depend on CONFIG_CRC32 after we added support
    for the filehandle hash.

    Reported-by: Paul Gortmaker
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

12 Mar, 2012

1 commit

  • net/sunrpc/svcsock.c:412:22: warning: incorrect type in assignment
    (different address spaces)
    - svc_partial_recvfrom now takes a struct kvec, so the variable
    save_iovbase needs to be an ordinary (void *)

    Make a bunch of variables in net/sunrpc/xprtsock.c static

    Fix a couple of "warning: symbol 'foo' was not declared. Should it be
    static?" reports.

    Fix a couple of conflicting function declarations.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

07 Mar, 2012

1 commit


03 Mar, 2012

3 commits

  • NFSv4.0 clients must send endpoint information for their callback
    service to NFSv4.0 servers during their first contact with a server.
    Traditionally on Linux, user space provides the callback endpoint IP
    address via the "clientaddr=" mount option.

    During an NFSv4 migration event, it is possible that an FSID may be
    migrated to a destination server that is accessible via a different
    source IP address than the source server was. The client must update
    callback endpoint information on the destination server so that it can
    maintain leases and allow delegation.

    Without a new "clientaddr=" option from user space, however, the
    kernel itself must construct an appropriate IP address for the
    callback update. Provide an API in the RPC client for upper layer
    RPC consumers to acquire a source address for a remote.

    The mechanism used by the mount.nfs command is copied: set up a
    connected UDP socket to the designated remote, then scrape the source
    address off the socket. We are careful to select the correct network
    namespace when setting up the temporary UDP socket.

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

    Chuck Lever
     
  • When the cl_xprt field is updated, the cl_server field will also have
    to change. Since the contents of cl_server follow the remote endpoint
    of cl_xprt, just move that field to the rpc_xprt.

    Signed-off-by: Trond Myklebust
    [ cel: simplify check_gss_callback_principal(), whitespace changes ]
    [ cel: forward ported to 3.4 ]
    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • A migration event will replace the rpc_xprt used by an rpc_clnt. To
    ensure this can be done safely, all references to cl_xprt must now use
    a form of rcu_dereference().

    Special care is taken with rpc_peeraddr2str(), which returns a pointer
    to memory whose lifetime is the same as the rpc_xprt.

    Signed-off-by: Trond Myklebust
    [ cel: fix lockdep splats and layering violations ]
    [ cel: forward ported to 3.4 ]
    [ cel: remove rpc_max_reqs(), add rpc_net_ns() ]
    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

28 Feb, 2012

1 commit

  • Currently, wait queue, used for polling of RPC pipe changes from user-space,
    is a part of RPC pipe. But the pipe data itself can be released on NFS umount
    prior to dentry-inode pair, connected to it (is case of this pair is open by
    some process).
    This is not a problem for almost all pipe users, because all PipeFS file
    operations checks pipe reference prior to using it.
    Except evenfd. This thing registers itself with "poll" file operation and thus
    has a reference to pipe wait queue. This leads to oopses on destroying eventfd
    after NFS umount (like rpc_idmapd do) since not pipe data left to the point
    already.
    The solution is to wait queue from pipe data to internal RPC inode data. This
    looks more logical, because this wiat queue used only for user-space processes,
    which already holds inode reference.

    Note: upcalls have to get pipe->dentry prior to dereferecing wait queue to make
    sure, that mount point won't disappear from underneath us.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: Trond Myklebust

    Stanislav Kinsbursky
     

18 Feb, 2012

2 commits


17 Feb, 2012

1 commit

  • Our dprintk() debugging facility doesn't specify any verbosity level
    for it's printk() calls, but it should.

    The default verbosity for printk's is KERN_DEFAULT. You might argue
    that these are debugging printk's and thus the verbosity should be
    KERN_DEBUG. That would mean that to see NFS and SUNRPC debugging
    output an admin would also have to boost the syslog verbosity, which
    would be insufferably noisy.

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

    Chuck Lever