26 Jan, 2019

1 commit

  • commit c156618e15101a9cc8c815108fec0300a0ec6637 upstream.

    The following deadlock can occur between a process waiting for a client
    to initialize in while walking the client list during nfsv4 server trunking
    detection and another process waiting for the nfs_clid_init_mutex so it
    can initialize that client:

    Process 1 Process 2
    --------- ---------
    spin_lock(&nn->nfs_client_lock);
    list_add_tail(&CLIENTA->cl_share_link,
    &nn->nfs_client_list);
    spin_unlock(&nn->nfs_client_lock);
    spin_lock(&nn->nfs_client_lock);
    list_add_tail(&CLIENTB->cl_share_link,
    &nn->nfs_client_list);
    spin_unlock(&nn->nfs_client_lock);
    mutex_lock(&nfs_clid_init_mutex);
    nfs41_walk_client_list(clp, result, cred);
    nfs_wait_client_init_complete(CLIENTA);
    (waiting for nfs_clid_init_mutex)

    Make sure nfs_match_client() only evaluates clients that have completed
    initialization in order to prevent that deadlock.

    This patch also fixes v4.0 trunking behavior by not marking the client
    NFS_CS_READY until the clientid has been confirmed.

    Signed-off-by: Scott Mayhew
    Signed-off-by: Anna Schumaker
    Signed-off-by: Qian Lu
    Signed-off-by: Greg Kroah-Hartman

    Scott Mayhew
     

02 Oct, 2017

1 commit

  • Michael Sterrett reports a NULL pointer dereference on NFSv3 mounts when
    CONFIG_NFS_V4 is not set because the NFS UOC rpc_wait_queue has not been
    initialized. Move the initialization of the queue out of the CONFIG_NFS_V4
    conditional setion.

    Fixes: 7d6ddf88c4db ("NFS: Add an iocounter wait function for async RPC tasks")
    Cc: stable@vger.kernel.org # 4.11+
    Signed-off-by: Benjamin Coddington
    Signed-off-by: Trond Myklebust

    Benjamin Coddington
     

20 Jul, 2017

1 commit


11 May, 2017

1 commit

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

    Stable bugfixes:
    - Fix use after free in write error path
    - Use GFP_NOIO for two allocations in writeback
    - Fix a hang in OPEN related to server reboot
    - Check the result of nfs4_pnfs_ds_connect
    - Fix an rcu lock leak

    Features:
    - Removal of the unmaintained and unused OSD pNFS layout
    - Cleanup and removal of lots of unnecessary dprintk()s
    - Cleanup and removal of some memory failure paths now that GFP_NOFS
    is guaranteed to never fail.
    - Remove the v3-only data server limitation on pNFS/flexfiles

    Bugfixes:
    - RPC/RDMA connection handling bugfixes
    - Copy offload: fixes to ensure the copied data is COMMITed to disk.
    - Readdir: switch back to using the ->iterate VFS interface
    - File locking fixes from Ben Coddington
    - Various use-after-free and deadlock issues in pNFS
    - Write path bugfixes"

    * tag 'nfs-for-4.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (89 commits)
    pNFS/flexfiles: Always attempt to call layoutstats when flexfiles is enabled
    NFSv4.1: Work around a Linux server bug...
    NFS append COMMIT after synchronous COPY
    NFSv4: Fix exclusive create attributes encoding
    NFSv4: Fix an rcu lock leak
    nfs: use kmap/kunmap directly
    NFS: always treat the invocation of nfs_getattr as cache hit when noac is on
    Fix nfs_client refcounting if kmalloc fails in nfs4_proc_exchange_id and nfs4_proc_async_renew
    NFSv4.1: RECLAIM_COMPLETE must handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION
    pNFS: Fix NULL dereference in pnfs_generic_alloc_ds_commits
    pNFS: Fix a typo in pnfs_generic_alloc_ds_commits
    pNFS: Fix a deadlock when coalescing writes and returning the layout
    pNFS: Don't clear the layout return info if there are segments to return
    pNFS: Ensure we commit the layout if it has been invalidated
    pNFS: Don't send COMMITs to the DSes if the server invalidated our layout
    pNFS/flexfiles: Fix up the ff_layout_write_pagelist failure path
    pNFS: Ensure we check layout validity before marking it for return
    NFS4.1 handle interrupted slot reuse from ERR_DELAY
    NFSv4: check return value of xdr_inline_decode
    nfs/filelayout: fix NULL pointer dereference in fl_pnfs_update_layout()
    ...

    Linus Torvalds
     

21 Apr, 2017

5 commits

  • NFS would enjoy the ability to modify the behavior of the NLM client's
    unlock RPC task in order to delay the transmission of the unlock until IO
    that was submitted under that lock has completed. This ability can ensure
    that the NLM client will always complete the transmission of an unlock even
    if the waiting caller has been interrupted with fatal signal.

    For this purpose, a pointer to a struct nlmclnt_operations can be assigned
    in a nfs_module's nfs_rpc_ops that will install those nlmclnt_operations on
    the nlm_host. The struct nlmclnt_operations defines three callback
    operations that will be used in a following patch:

    nlmclnt_alloc_call - used to call back after a successful allocation of
    a struct nlm_rqst in nlmclnt_proc().

    nlmclnt_unlock_prepare - used to call back during NLM unlock's
    rpc_call_prepare. The NLM client defers calling rpc_call_start()
    until this callback returns false.

    nlmclnt_release_call - used to call back when the NLM client's struct
    nlm_rqst is freed.

    Signed-off-by: Benjamin Coddington
    Reviewed-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Benjamin Coddington
     
  • By sleeping on a new NFS Unlock-On-Close waitqueue, rpc tasks may wait for
    a lock context's iocounter to reach zero. The rpc waitqueue is only woken
    when the open_context has the NFS_CONTEXT_UNLOCK flag set in order to
    mitigate spurious wake-ups for any iocounter reaching zero.

    Signed-off-by: Benjamin Coddington
    Reviewed-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Benjamin Coddington
     
  • Allocate struct backing_dev_info separately instead of embedding it
    inside the superblock. This unifies handling of bdi among users.

    CC: Anna Schumaker
    CC: linux-nfs@vger.kernel.org
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara
    Acked-by: Trond Myklebust
    Signed-off-by: Jens Axboe

    Jan Kara
     
  • Signed-off-by: Anna Schumaker
    Signed-off-by: Trond Myklebust

    Anna Schumaker
     
  • We always call nfs_mark_client_ready() even if nfs_create_rpc_client()
    returns an error, so we can rearrange nfs_init_client() to mark the
    client ready from a single place.

    Signed-off-by: Anna Schumaker
    Signed-off-by: Trond Myklebust

    Anna Schumaker
     

18 Mar, 2017

1 commit

  • The nfs4_pnfs_ds_connect path can call rpc_create which can fail or it
    can wait on another context to reach the same failure.

    This checks that the rpc_create succeeded and returns the error to the
    caller.

    When an error is returned, both the files and flexfiles layouts will return
    NULL from _prepare_ds(). The flexfiles layout will also return the layout
    with the error NFS4ERR_NXIO.

    Signed-off-by: Weston Andros Adamson
    Signed-off-by: Anna Schumaker

    Weston Andros Adamson
     

02 Dec, 2016

1 commit


08 Nov, 2016

1 commit

  • cl_rpcclient starts as ERR_PTR(-EINVAL), and connections like that
    are floating freely through the system. Most places check whether
    pointer is valid before dereferencing it, but newly added code
    in nfs_match_client does not.

    Which causes crashes when more than one NFS mount point is present.

    Signed-off-by: Petr Vandrovec
    Signed-off-by: Anna Schumaker

    Petr Vandrovec
     

05 Oct, 2016

1 commit

  • boot_time is represented as a struct timespec.
    struct timespec and CURRENT_TIME are not y2038 safe.
    Overall, the plan is to use timespec64 and ktime_t for
    all internal kernel representation of timestamps.
    CURRENT_TIME will also be removed.

    boot_time is used to construct the nfs client boot verifier.

    Use ktime_t to represent boot_time and ktime_get_real() for
    the boot_time value.

    Following Trond's request https://lkml.org/lkml/2016/6/9/22 ,
    use ktime_t instead of converting to struct timespec64.

    Use higher and lower 32 bit parts of ktime_t for the boot
    verifier.

    Use the lower 32 bit part of ktime_t for the authsys_parms
    stamp field.

    Signed-off-by: Deepa Dinamani
    Reviewed-by: Arnd Bergmann
    Cc: Trond Myklebust
    Cc: Anna Schumaker
    Cc: linux-nfs@vger.kernel.org
    Signed-off-by: Anna Schumaker

    Deepa Dinamani
     

20 Sep, 2016

3 commits

  • Currently, the layout driver selection code always chooses the first one
    from the list. That's not really ideal however, as the server can send
    the list of layout types in any order that it likes. It's up to the
    client to select the best one for its needs.

    This patch adds an ordered list of preferred driver types and has the
    selection code sort the list of available layout drivers according to it.
    Any unrecognized layout type is sorted to the end of the list.

    For now, the order of preference is hardcoded, but it should be possible
    to make this configurable in the future.

    Signed-off-by: Jeff Layton
    Reviewed-by: J. Bruce Fields
    Signed-off-by: Anna Schumaker

    Jeff Layton
     
  • Signed-off-by: Andy Adamson
    Signed-off-by: Anna Schumaker

    Andy Adamson
     
  • Current NFSv4.1/pNFS client assumes that MDS supports only one layout
    type. While it's true for most existing servers, nevertheless, this can
    be change in the near future.

    For now, this patch just plumbs in the ability to track a list of
    layouts in the fsinfo structure. The existing behavior of the client
    is preserved, by having it just select the first entry in the list.

    Signed-off-by: Tigran Mkrtchyan
    Signed-off-by: Jeff Layton
    Reviewed-by: J. Bruce Fields
    Signed-off-by: Anna Schumaker

    Jeff Layton
     

16 Aug, 2016

1 commit

  • We should allow retrans=0 as just meaning that every timeout is a major
    timeout, and that there is no increment in the timeout value.

    For instance, this means that we would allow TCP users to specify a
    flat timeout value of 60s, by specifying "timeo=600,retrans=0" in their
    mount option string.

    Siged-off-by: Trond Myklebust

    Trond Myklebust
     

31 Jul, 2016

1 commit

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

    Stable bugfixes:
    - nfs: don't create zero-length requests

    - several LAYOUTGET bugfixes

    Features:
    - several performance related features

    - more aggressive caching when we can rely on close-to-open
    cache consistency

    - remove serialisation of O_DIRECT reads and writes

    - optimise several code paths to not flush to disk unnecessarily.

    However allow for the idiosyncracies of pNFS for those layout
    types that need to issue a LAYOUTCOMMIT before the metadata can
    be updated on the server.

    - SUNRPC updates to the client data receive path

    - pNFS/SCSI support RH/Fedora dm-mpath device nodes

    - pNFS files/flexfiles can now use unprivileged ports when
    the generic NFS mount options allow it.

    Bugfixes:
    - Don't use RDMA direct data placement together with data
    integrity or privacy security flavours

    - Remove the RDMA ALLPHYSICAL memory registration mode as
    it has potential security holes.

    - Several layout recall fixes to improve NFSv4.1 protocol
    compliance.

    - Fix an Oops in the pNFS files and flexfiles connection
    setup to the DS

    - Allow retry of operations that used a returned delegation
    stateid

    - Don't mark the inode as revalidated if a LAYOUTCOMMIT is
    outstanding

    - Fix writeback races in nfs4_copy_range() and
    nfs42_proc_deallocate()"

    * tag 'nfs-for-4.8-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (104 commits)
    pNFS: Actively set attributes as invalid if LAYOUTCOMMIT is outstanding
    NFSv4: Clean up lookup of SECINFO_NO_NAME
    NFSv4.2: Fix warning "variable ‘stateids’ set but not used"
    NFSv4: Fix warning "no previous prototype for ‘nfs4_listxattr’"
    SUNRPC: Fix a compiler warning in fs/nfs/clnt.c
    pNFS: Remove redundant smp_mb() from pnfs_init_lseg()
    pNFS: Cleanup - do layout segment initialisation in one place
    pNFS: Remove redundant stateid invalidation
    pNFS: Remove redundant pnfs_mark_layout_returned_if_empty()
    pNFS: Clear the layout metadata if the server changed the layout stateid
    pNFS: Cleanup - don't open code pnfs_mark_layout_stateid_invalid()
    NFS: pnfs_mark_matching_lsegs_return() should match the layout sequence id
    pNFS: Do not set plh_return_seq for non-callback related layoutreturns
    pNFS: Ensure layoutreturn acts as a completion for layout callbacks
    pNFS: Fix CB_LAYOUTRECALL stateid verification
    pNFS: Always update the layout barrier seqid on LAYOUTGET
    pNFS: Always update the layout stateid if NFS_LAYOUT_INVALID_STID is set
    pNFS: Clear the layout return tracking on layout reinitialisation
    pNFS: LAYOUTRETURN should only update the stateid if the layout is valid
    nfs: don't create zero-length requests
    ...

    Linus Torvalds
     

01 Jul, 2016

1 commit

  • Chris Worley reports:
    RIP: 0010:[] [] rpc_new_client+0x2a0/0x2e0 [sunrpc]
    RSP: 0018:ffff880158f6f548 EFLAGS: 00010246
    RAX: 0000000000000000 RBX: ffff880234f8bc00 RCX: 000000000000ea60
    RDX: 0000000000074cc0 RSI: 000000000000ea60 RDI: ffff880234f8bcf0
    RBP: ffff880158f6f588 R08: 000000000001ac80 R09: ffff880237003300
    R10: ffff880201171000 R11: ffffea0000d75200 R12: ffffffffa03afc60
    R13: ffff880230c18800 R14: 0000000000000000 R15: ffff880158f6f680
    FS: 00007f0e32673740(0000) GS:ffff88023fc40000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000008 CR3: 0000000234886000 CR4: 00000000001406e0
    Stack:
    ffffffffa047a680 0000000000000000 ffff880158f6f598 ffff880158f6f680
    ffff880158f6f680 ffff880234d11d00 ffff88023357f800 ffff880158f6f7d0
    ffff880158f6f5b8 ffffffffa024660a ffff880158f6f5b8 ffffffffa02492ec
    Call Trace:
    [] rpc_create_xprt+0x1a/0xb0 [sunrpc]
    [] ? xprt_create_transport+0x13c/0x240 [sunrpc]
    [] rpc_create+0xc6/0x1a0 [sunrpc]
    [] nfs_create_rpc_client+0xf5/0x140 [nfs]
    [] nfs_init_client+0x3a/0xd0 [nfs]
    [] nfs_get_client+0x25f/0x310 [nfs]
    [] ? rpc_ntop+0xe8/0x100 [sunrpc]
    [] nfs3_set_ds_client+0xcc/0x100 [nfsv3]
    [] nfs4_pnfs_ds_connect+0x120/0x400 [nfsv4]
    [] nfs4_ff_layout_prepare_ds+0xe7/0x330 [nfs_layout_flexfiles]
    [] ff_layout_pg_init_write+0xcb/0x280 [nfs_layout_flexfiles]
    [] __nfs_pageio_add_request+0x12c/0x490 [nfs]
    [] nfs_pageio_add_request+0xc2/0x2a0 [nfs]
    [] ? nfs_pageio_init+0x75/0x120 [nfs]
    [] nfs_do_writepage+0x120/0x270 [nfs]
    [] nfs_writepage_locked+0x61/0xc0 [nfs]
    [] ? __percpu_counter_add+0x55/0x70
    [] nfs_wb_single_page+0xef/0x1c0 [nfs]
    [] ? __dec_zone_page_state+0x33/0x40
    [] nfs_launder_page+0x41/0x90 [nfs]
    [] invalidate_inode_pages2_range+0x340/0x3a0
    [] invalidate_inode_pages2+0x17/0x20
    [] nfs_release+0x9e/0xb0 [nfs]
    [] ? nfs_open+0x60/0x60 [nfs]
    [] nfs_file_release+0x3d/0x60 [nfs]
    [] __fput+0xdc/0x1e0
    [] ____fput+0xe/0x10
    [] task_work_run+0xc4/0xe0
    [] do_exit+0x2e8/0xb30
    [] ? do_audit_syscall_entry+0x6c/0x70
    [] ? __audit_syscall_exit+0x1e6/0x280
    [] do_group_exit+0x3f/0xa0
    [] SyS_exit_group+0x14/0x20
    [] system_call_fastpath+0x12/0x71

    Which seems to be due to a call to utsname() when in a task exit context
    in order to determine the hostname to set in rpc_new_client().

    In reality, what we want here is not the hostname of the current task, but
    the hostname that was used to set up the metadata server.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

30 May, 2016

1 commit


05 Apr, 2016

1 commit

  • PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
    ago with promise that one day it will be possible to implement page
    cache with bigger chunks than PAGE_SIZE.

    This promise never materialized. And unlikely will.

    We have many places where PAGE_CACHE_SIZE assumed to be equal to
    PAGE_SIZE. And it's constant source of confusion on whether
    PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
    especially on the border between fs and mm.

    Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
    breakage to be doable.

    Let's stop pretending that pages in page cache are special. They are
    not.

    The changes are pretty straight-forward:

    - << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> ;

    - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};

    - page_cache_get() -> get_page();

    - page_cache_release() -> put_page();

    This patch contains automated changes generated with coccinelle using
    script below. For some reason, coccinelle doesn't patch header files.
    I've called spatch for them manually.

    The only adjustment after coccinelle is revert of changes to
    PAGE_CAHCE_ALIGN definition: we are going to drop it later.

    There are few places in the code where coccinelle didn't reach. I'll
    fix them manually in a separate patch. Comments and documentation also
    will be addressed with the separate patch.

    virtual patch

    @@
    expression E;
    @@
    - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    expression E;
    @@
    - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
    + E

    @@
    @@
    - PAGE_CACHE_SHIFT
    + PAGE_SHIFT

    @@
    @@
    - PAGE_CACHE_SIZE
    + PAGE_SIZE

    @@
    @@
    - PAGE_CACHE_MASK
    + PAGE_MASK

    @@
    expression E;
    @@
    - PAGE_CACHE_ALIGN(E)
    + PAGE_ALIGN(E)

    @@
    expression E;
    @@
    - page_cache_get(E)
    + get_page(E)

    @@
    expression E;
    @@
    - page_cache_release(E)
    + put_page(E)

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Michal Hocko
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

16 Oct, 2015

1 commit


18 Aug, 2015

1 commit


23 Jul, 2015

1 commit


01 Jul, 2015

2 commits


16 Jun, 2015

1 commit

  • A truncated fsid showing from /proc/fs/nfsfs/volumes as,
    NV SERVER PORT DEV FSID FSC
    v4 c0a80881 801 0:43 34931f044c2a439b no

    It should be as,
    NV SERVER PORT DEV FSID FSC
    v4 c0a80881 801 0:43 34931f044c2a439b:954c5d830fa4be8c no

    The max buffer length for storing "%llx:%llx" format should be
    16 + 1 + 16 + 1 = 34 (16 for %llx, 1 for ':', 1 for '\0').

    Also, for storing "%u:%u" of MAJOR() and MINOR() should be
    8 + 1 + 3 + 1 = 13 (8 for 2^24, 1 for ':', 3 for 2^8, 1 for '\0').

    v2, add comments for dev/fsid buffer and use sizeof in snprintf.

    Signed-off-by: Kinglong Mee
    Signed-off-by: Trond Myklebust

    Kinglong Mee
     

24 Apr, 2015

1 commit


04 Mar, 2015

1 commit


01 Oct, 2014

1 commit

  • * bugfixes:
    NFSv4.1: Fix an NFSv4.1 state renewal regression
    NFSv4: fix open/lock state recovery error handling
    NFSv4: Fix lock recovery when CREATE_SESSION/SETCLIENTID_CONFIRM fails
    NFS: Fabricate fscache server index key correctly
    SUNRPC: Add missing support for RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT
    nfs: fix duplicate proc entries

    Trond Myklebust
     

25 Sep, 2014

1 commit

  • Commit 65b38851a174
    ("NFS: Fix /proc/fs/nfsfs/servers and /proc/fs/nfsfs/volumes")

    updated the following function:
    static int nfs_volume_list_open(struct inode *inode, struct file *file)

    it used &nfs_server_list_ops instead of &nfs_volume_list_ops
    which means cat /proc/fs/nfsfs/volumes = /proc/fs/nfsfs/servers

    Signed-off-by: Fabian Frederick
    Fixes: 65b38851a174 (NFS: Fix /proc/fs/nfsfs/servers and...)
    Cc: stable@vger.kernel.org # 3.4.x+
    Signed-off-by: Trond Myklebust

    Fabian Frederick
     

11 Sep, 2014

1 commit


09 Sep, 2014

1 commit

  • I saw the following kernel warning:

    [ 1852.321222] ------------[ cut here ]------------
    [ 1852.326527] WARNING: CPU: 0 PID: 118 at fs/proc/generic.c:521 remove_proc_entry+0x154/0x16b()
    [ 1852.335630] remove_proc_entry: removing non-empty directory 'fs/nfsfs', leaking at least 'volumes'
    [ 1852.344084] CPU: 0 PID: 118 Comm: kworker/u8:2 Not tainted 3.16.0+ #540
    [ 1852.350036] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    [ 1852.354992] Workqueue: netns cleanup_net
    [ 1852.358701] 0000000000000000 ffff880116f2fbd0 ffffffff819c03e9 ffff880116f2fc18
    [ 1852.366474] ffff880116f2fc08 ffffffff810744ee ffffffff811e0e6e ffff8800d4e96238
    [ 1852.373507] ffffffff81dbe665 ffff8800d46a5948 0000000000000005 ffff880116f2fc68
    [ 1852.380224] Call Trace:
    [ 1852.381976] [] dump_stack+0x4d/0x66
    [ 1852.385495] [] warn_slowpath_common+0x7a/0x93
    [ 1852.389869] [] ? remove_proc_entry+0x154/0x16b
    [ 1852.393987] [] warn_slowpath_fmt+0x4c/0x4e
    [ 1852.397999] [] remove_proc_entry+0x154/0x16b
    [ 1852.402034] [] nfs_fs_proc_net_exit+0x53/0x56
    [ 1852.406136] [] nfs_net_exit+0x12/0x1d
    [ 1852.409774] [] ops_exit_list+0x44/0x55
    [ 1852.413529] [] cleanup_net+0xee/0x182
    [ 1852.417198] [] process_one_work+0x209/0x40d
    [ 1852.502320] [] ? process_one_work+0x162/0x40d
    [ 1852.587629] [] worker_thread+0x1f0/0x2c7
    [ 1852.673291] [] ? process_scheduled_works+0x2f/0x2f
    [ 1852.759470] [] kthread+0xc9/0xd1
    [ 1852.843099] [] ? finish_task_switch+0x3a/0xce
    [ 1852.926518] [] ? __kthread_parkme+0x61/0x61
    [ 1853.008565] [] ret_from_fork+0x7c/0xb0
    [ 1853.076477] [] ? __kthread_parkme+0x61/0x61
    [ 1853.140653] ---[ end trace 69c4c6617f78e32d ]---

    It looks wrong that we add "/proc/net/nfsfs" in nfs_fs_proc_net_init()
    while remove "/proc/fs/nfsfs" in nfs_fs_proc_net_exit().

    Fixes: commit 65b38851a17 (NFS: Fix /proc/fs/nfsfs/servers and /proc/fs/nfsfs/volumes)
    Cc: Eric W. Biederman
    Cc: Trond Myklebust
    Cc: Dan Aloni
    Signed-off-by: Cong Wang
    [Trond: replace uses of remove_proc_entry() with remove_proc_subtree()
    as suggested by Al Viro]
    Cc: stable@vger.kernel.org # 3.4.x : 65b38851a17: NFS: Fix /proc/fs/nfsfs/servers
    Cc: stable@vger.kernel.org # 3.4.x
    Signed-off-by: Trond Myklebust

    Cong Wang
     

14 Aug, 2014

1 commit

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

    - stable fix for a bug in nfs3_list_one_acl()
    - speed up NFS path walks by supporting LOOKUP_RCU
    - more read/write code cleanups
    - pNFS fixes for layout return on close
    - fixes for the RCU handling in the rpcsec_gss code
    - more NFS/RDMA fixes"

    * tag 'nfs-for-3.17-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (79 commits)
    nfs: reject changes to resvport and sharecache during remount
    NFS: Avoid infinite loop when RELEASE_LOCKOWNER getting expired error
    SUNRPC: remove all refcounting of groupinfo from rpcauth_lookupcred
    NFS: fix two problems in lookup_revalidate in RCU-walk
    NFS: allow lockless access to access_cache
    NFS: teach nfs_lookup_verify_inode to handle LOOKUP_RCU
    NFS: teach nfs_neg_need_reval to understand LOOKUP_RCU
    NFS: support RCU_WALK in nfs_permission()
    sunrpc/auth: allow lockless (rcu) lookup of credential cache.
    NFS: prepare for RCU-walk support but pushing tests later in code.
    NFS: nfs4_lookup_revalidate: only evaluate parent if it will be used.
    NFS: add checks for returned value of try_module_get()
    nfs: clear_request_commit while holding i_lock
    pnfs: add pnfs_put_lseg_async
    pnfs: find swapped pages on pnfs commit lists too
    nfs: fix comment and add warn_on for PG_INODE_REF
    nfs: check wait_on_bit_lock err in page_group_lock
    sunrpc: remove "ec" argument from encrypt_v2 operation
    sunrpc: clean up sparse endianness warnings in gss_krb5_wrap.c
    sunrpc: clean up sparse endianness warnings in gss_krb5_seal.c
    ...

    Linus Torvalds
     

05 Aug, 2014

1 commit

  • The usage of pid_ns->child_reaper->nsproxy->net_ns in
    nfs_server_list_open and nfs_client_list_open is not safe.

    /proc for a pid namespace can remain mounted after the all of the
    process in that pid namespace have exited. There are also times
    before the initial process in a pid namespace has started or after the
    initial process in a pid namespace has exited where
    pid_ns->child_reaper can be NULL or stale. Making the idiom
    pid_ns->child_reaper->nsproxy a double whammy of problems.

    Luckily all that needs to happen is to move /proc/fs/nfsfs/servers and
    /proc/fs/nfsfs/volumes under /proc/net to /proc/net/nfsfs/servers and
    /proc/net/nfsfs/volumes and add a symlink from the original location,
    and to use seq_open_net as it has been designed.

    Cc: stable@vger.kernel.org
    Cc: Trond Myklebust
    Cc: Stanislav Kinsbursky
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

04 Aug, 2014

1 commit

  • There is a couple of places in client code where returned value
    of try_module_get() is ignored. As a result there is a small chance
    to premature unload module because of unbalanced refcounting.

    The patch adds error handling in that places.

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Alexey Khoroshilov
    Signed-off-by: Trond Myklebust

    Alexey Khoroshilov
     

13 Jul, 2014

1 commit

  • The current CB_COMPOUND handling code tries to compare the principal
    name of the request with the cl_hostname in the client. This is not
    guaranteed to ever work, particularly if the client happened to mount
    a CNAME of the server or a non-fqdn.

    Fix this by instead comparing the cr_principal string with the acceptor
    name that we get from gssd. In the event that gssd didn't send one
    down (i.e. it was too old), then we fall back to trying to use the
    cl_hostname as we do today.

    Signed-off-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Jeff Layton
     

09 Jul, 2014

1 commit


29 Oct, 2013

2 commits