26 Sep, 2020

1 commit

  • It was an interesting idea but nobody seems to be using it, it's buggy
    at this point, and nfs4state.c is already complicated enough without it.
    The new nfsd/clients/ code provides some of the same functionality, and
    could probably do more if desired.

    This feature has been deprecated since 9d60d93198c6 ("Deprecate nfsd
    fault injection").

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

05 Aug, 2020

1 commit

  • Pull uninitialized_var() macro removal from Kees Cook:
    "This is long overdue, and has hidden too many bugs over the years. The
    series has several "by hand" fixes, and then a trivial treewide
    replacement.

    - Clean up non-trivial uses of uninitialized_var()

    - Update documentation and checkpatch for uninitialized_var() removal

    - Treewide removal of uninitialized_var()"

    * tag 'uninit-macro-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    compiler: Remove uninitialized_var() macro
    treewide: Remove uninitialized_var() usage
    checkpatch: Remove awareness of uninitialized_var() macro
    mm/debug_vm_pgtable: Remove uninitialized_var() usage
    f2fs: Eliminate usage of uninitialized_var() macro
    media: sur40: Remove uninitialized_var() usage
    KVM: PPC: Book3S PR: Remove uninitialized_var() usage
    clk: spear: Remove uninitialized_var() usage
    clk: st: Remove uninitialized_var() usage
    spi: davinci: Remove uninitialized_var() usage
    ide: Remove uninitialized_var() usage
    rtlwifi: rtl8192cu: Remove uninitialized_var() usage
    b43: Remove uninitialized_var() usage
    drbd: Remove uninitialized_var() usage
    x86/mm/numa: Remove uninitialized_var() usage
    docs: deprecated.rst: Add uninitialized_var()

    Linus Torvalds
     

17 Jul, 2020

1 commit

  • Using uninitialized_var() is dangerous as it papers over real bugs[1]
    (or can in the future), and suppresses unrelated compiler warnings
    (e.g. "unused variable"). If the compiler thinks it is uninitialized,
    either simply initialize the variable or make compiler changes.

    In preparation for removing[2] the[3] macro[4], remove all remaining
    needless uses with the following script:

    git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \
    xargs perl -pi -e \
    's/\buninitialized_var\(([^\)]+)\)/\1/g;
    s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;'

    drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid
    pathological white-space.

    No outstanding warnings were found building allmodconfig with GCC 9.3.0
    for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64,
    alpha, and m68k.

    [1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/
    [2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/
    [3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/
    [4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/

    Reviewed-by: Leon Romanovsky # drivers/infiniband and mlx4/mlx5
    Acked-by: Jason Gunthorpe # IB
    Acked-by: Kalle Valo # wireless drivers
    Reviewed-by: Chao Yu # erofs
    Signed-off-by: Kees Cook

    Kees Cook
     

30 Jun, 2020

2 commits

  • I don't understand this code well, but I'm seeing a warning about a
    still-referenced inode on unmount, and every other similar filesystem
    does a dput() here.

    Fixes: e8a79fb14f6b ("nfsd: add nfsd/clients directory")
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • We don't drop the reference on the nfsdfs filesystem with
    mntput(nn->nfsd_mnt) until nfsd_exit_net(), but that won't be called
    until the nfsd module's unloaded, and we can't unload the module as long
    as there's a reference on nfsdfs. So this prevents module unloading.

    Fixes: 2c830dd7209b ("nfsd: persist nfsd filesystem across mounts")
    Reported-and-Tested-by: Luo Xiaogang
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

02 Jun, 2020

1 commit

  • I made every global per-network-namespace instead. But perhaps doing
    that to this slab was a step too far.

    The kmem_cache_create call in our net init method also seems to be
    responsible for this lockdep warning:

    [ 45.163710] Unable to find swap-space signature
    [ 45.375718] trinity-c1 (855): attempted to duplicate a private mapping with mremap. This is not supported.
    [ 46.055744] futex_wake_op: trinity-c1 tries to shift op by -209; fix this program
    [ 51.011723]
    [ 51.013378] ======================================================
    [ 51.013875] WARNING: possible circular locking dependency detected
    [ 51.014378] 5.2.0-rc2 #1 Not tainted
    [ 51.014672] ------------------------------------------------------
    [ 51.015182] trinity-c2/886 is trying to acquire lock:
    [ 51.015593] 000000005405f099 (slab_mutex){+.+.}, at: slab_attr_store+0xa2/0x130
    [ 51.016190]
    [ 51.016190] but task is already holding lock:
    [ 51.016652] 00000000ac662005 (kn->count#43){++++}, at: kernfs_fop_write+0x286/0x500
    [ 51.017266]
    [ 51.017266] which lock already depends on the new lock.
    [ 51.017266]
    [ 51.017909]
    [ 51.017909] the existing dependency chain (in reverse order) is:
    [ 51.018497]
    [ 51.018497] -> #1 (kn->count#43){++++}:
    [ 51.018956] __lock_acquire+0x7cf/0x1a20
    [ 51.019317] lock_acquire+0x17d/0x390
    [ 51.019658] __kernfs_remove+0x892/0xae0
    [ 51.020020] kernfs_remove_by_name_ns+0x78/0x110
    [ 51.020435] sysfs_remove_link+0x55/0xb0
    [ 51.020832] sysfs_slab_add+0xc1/0x3e0
    [ 51.021332] __kmem_cache_create+0x155/0x200
    [ 51.021720] create_cache+0xf5/0x320
    [ 51.022054] kmem_cache_create_usercopy+0x179/0x320
    [ 51.022486] kmem_cache_create+0x1a/0x30
    [ 51.022867] nfsd_reply_cache_init+0x278/0x560
    [ 51.023266] nfsd_init_net+0x20f/0x5e0
    [ 51.023623] ops_init+0xcb/0x4b0
    [ 51.023928] setup_net+0x2fe/0x670
    [ 51.024315] copy_net_ns+0x30a/0x3f0
    [ 51.024653] create_new_namespaces+0x3c5/0x820
    [ 51.025257] unshare_nsproxy_namespaces+0xd1/0x240
    [ 51.025881] ksys_unshare+0x506/0x9c0
    [ 51.026381] __x64_sys_unshare+0x3a/0x50
    [ 51.026937] do_syscall_64+0x110/0x10b0
    [ 51.027509] entry_SYSCALL_64_after_hwframe+0x49/0xbe
    [ 51.028175]
    [ 51.028175] -> #0 (slab_mutex){+.+.}:
    [ 51.028817] validate_chain+0x1c51/0x2cc0
    [ 51.029422] __lock_acquire+0x7cf/0x1a20
    [ 51.029947] lock_acquire+0x17d/0x390
    [ 51.030438] __mutex_lock+0x100/0xfa0
    [ 51.030995] mutex_lock_nested+0x27/0x30
    [ 51.031516] slab_attr_store+0xa2/0x130
    [ 51.032020] sysfs_kf_write+0x11d/0x180
    [ 51.032529] kernfs_fop_write+0x32a/0x500
    [ 51.033056] do_loop_readv_writev+0x21d/0x310
    [ 51.033627] do_iter_write+0x2e5/0x380
    [ 51.034148] vfs_writev+0x170/0x310
    [ 51.034616] do_pwritev+0x13e/0x160
    [ 51.035100] __x64_sys_pwritev+0xa3/0x110
    [ 51.035633] do_syscall_64+0x110/0x10b0
    [ 51.036200] entry_SYSCALL_64_after_hwframe+0x49/0xbe
    [ 51.036924]
    [ 51.036924] other info that might help us debug this:
    [ 51.036924]
    [ 51.037876] Possible unsafe locking scenario:
    [ 51.037876]
    [ 51.038556] CPU0 CPU1
    [ 51.039130] ---- ----
    [ 51.039676] lock(kn->count#43);
    [ 51.040084] lock(slab_mutex);
    [ 51.040597] lock(kn->count#43);
    [ 51.041062] lock(slab_mutex);
    [ 51.041320]
    [ 51.041320] *** DEADLOCK ***
    [ 51.041320]
    [ 51.041793] 3 locks held by trinity-c2/886:
    [ 51.042128] #0: 000000001f55e152 (sb_writers#5){.+.+}, at: vfs_writev+0x2b9/0x310
    [ 51.042739] #1: 00000000c7d6c034 (&of->mutex){+.+.}, at: kernfs_fop_write+0x25b/0x500
    [ 51.043400] #2: 00000000ac662005 (kn->count#43){++++}, at: kernfs_fop_write+0x286/0x500

    Reported-by: kernel test robot
    Fixes: 3ba75830ce17 "drc containerization"
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

21 May, 2020

1 commit

  • fs/nfsd/nfsctl.c:256: warning: Function parameter or member 'file' not described in 'write_unlock_ip'
    fs/nfsd/nfsctl.c:256: warning: Function parameter or member 'buf' not described in 'write_unlock_ip'
    fs/nfsd/nfsctl.c:256: warning: Function parameter or member 'size' not described in 'write_unlock_ip'
    fs/nfsd/nfsctl.c:295: warning: Function parameter or member 'file' not described in 'write_unlock_fs'
    fs/nfsd/nfsctl.c:295: warning: Function parameter or member 'buf' not described in 'write_unlock_fs'
    fs/nfsd/nfsctl.c:295: warning: Function parameter or member 'size' not described in 'write_unlock_fs'
    fs/nfsd/nfsctl.c:352: warning: Function parameter or member 'file' not described in 'write_filehandle'
    fs/nfsd/nfsctl.c:352: warning: Function parameter or member 'buf' not described in 'write_filehandle'
    fs/nfsd/nfsctl.c:352: warning: Function parameter or member 'size' not described in 'write_filehandle'
    fs/nfsd/nfsctl.c:434: warning: Function parameter or member 'file' not described in 'write_threads'
    fs/nfsd/nfsctl.c:434: warning: Function parameter or member 'buf' not described in 'write_threads'
    fs/nfsd/nfsctl.c:434: warning: Function parameter or member 'size' not described in 'write_threads'
    fs/nfsd/nfsctl.c:478: warning: Function parameter or member 'file' not described in 'write_pool_threads'
    fs/nfsd/nfsctl.c:478: warning: Function parameter or member 'buf' not described in 'write_pool_threads'
    fs/nfsd/nfsctl.c:478: warning: Function parameter or member 'size' not described in 'write_pool_threads'
    fs/nfsd/nfsctl.c:697: warning: Function parameter or member 'file' not described in 'write_versions'
    fs/nfsd/nfsctl.c:697: warning: Function parameter or member 'buf' not described in 'write_versions'
    fs/nfsd/nfsctl.c:697: warning: Function parameter or member 'size' not described in 'write_versions'
    fs/nfsd/nfsctl.c:858: warning: Function parameter or member 'file' not described in 'write_ports'
    fs/nfsd/nfsctl.c:858: warning: Function parameter or member 'buf' not described in 'write_ports'
    fs/nfsd/nfsctl.c:858: warning: Function parameter or member 'size' not described in 'write_ports'
    fs/nfsd/nfsctl.c:892: warning: Function parameter or member 'file' not described in 'write_maxblksize'
    fs/nfsd/nfsctl.c:892: warning: Function parameter or member 'buf' not described in 'write_maxblksize'
    fs/nfsd/nfsctl.c:892: warning: Function parameter or member 'size' not described in 'write_maxblksize'
    fs/nfsd/nfsctl.c:941: warning: Function parameter or member 'file' not described in 'write_maxconn'
    fs/nfsd/nfsctl.c:941: warning: Function parameter or member 'buf' not described in 'write_maxconn'
    fs/nfsd/nfsctl.c:941: warning: Function parameter or member 'size' not described in 'write_maxconn'
    fs/nfsd/nfsctl.c:1023: warning: Function parameter or member 'file' not described in 'write_leasetime'
    fs/nfsd/nfsctl.c:1023: warning: Function parameter or member 'buf' not described in 'write_leasetime'
    fs/nfsd/nfsctl.c:1023: warning: Function parameter or member 'size' not described in 'write_leasetime'
    fs/nfsd/nfsctl.c:1039: warning: Function parameter or member 'file' not described in 'write_gracetime'
    fs/nfsd/nfsctl.c:1039: warning: Function parameter or member 'buf' not described in 'write_gracetime'
    fs/nfsd/nfsctl.c:1039: warning: Function parameter or member 'size' not described in 'write_gracetime'
    fs/nfsd/nfsctl.c:1094: warning: Function parameter or member 'file' not described in 'write_recoverydir'
    fs/nfsd/nfsctl.c:1094: warning: Function parameter or member 'buf' not described in 'write_recoverydir'
    fs/nfsd/nfsctl.c:1094: warning: Function parameter or member 'size' not described in 'write_recoverydir'
    fs/nfsd/nfsctl.c:1125: warning: Function parameter or member 'file' not described in 'write_v4_end_grace'
    fs/nfsd/nfsctl.c:1125: warning: Function parameter or member 'buf' not described in 'write_v4_end_grace'
    fs/nfsd/nfsctl.c:1125: warning: Function parameter or member 'size' not described in 'write_v4_end_grace'

    fs/nfsd/nfs4proc.c:1164: warning: Function parameter or member 'nss' not described in 'nfsd4_interssc_connect'
    fs/nfsd/nfs4proc.c:1164: warning: Function parameter or member 'rqstp' not described in 'nfsd4_interssc_connect'
    fs/nfsd/nfs4proc.c:1164: warning: Function parameter or member 'mount' not described in 'nfsd4_interssc_connect'
    fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'rqstp' not described in 'nfsd4_setup_inter_ssc'
    fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'cstate' not described in 'nfsd4_setup_inter_ssc'
    fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'copy' not described in 'nfsd4_setup_inter_ssc'
    fs/nfsd/nfs4proc.c:1262: warning: Function parameter or member 'mount' not described in 'nfsd4_setup_inter_ssc'

    Signed-off-by: Chuck Lever

    Chuck Lever
     

19 Mar, 2020

1 commit


08 Feb, 2020

1 commit

  • Pull nfsd updates from Bruce Fields:
    "Highlights:

    - Server-to-server copy code from Olga.

    To use it, client and both servers must have support, the target
    server must be able to access the source server over NFSv4.2, and
    the target server must have the inter_copy_offload_enable module
    parameter set.

    - Improvements and bugfixes for the new filehandle cache, especially
    in the container case, from Trond

    - Also from Trond, better reporting of write errors.

    - Y2038 work from Arnd"

    * tag 'nfsd-5.6' of git://linux-nfs.org/~bfields/linux: (55 commits)
    sunrpc: expiry_time should be seconds not timeval
    nfsd: make nfsd_filecache_wq variable static
    nfsd4: fix double free in nfsd4_do_async_copy()
    nfsd: convert file cache to use over/underflow safe refcount
    nfsd: Define the file access mode enum for tracing
    nfsd: Fix a perf warning
    nfsd: Ensure sampling of the write verifier is atomic with the write
    nfsd: Ensure sampling of the commit verifier is atomic with the commit
    sunrpc: clean up cache entry add/remove from hashtable
    sunrpc: Fix potential leaks in sunrpc_cache_unhash()
    nfsd: Ensure exclusion between CLONE and WRITE errors
    nfsd: Pass the nfsd_file as arguments to nfsd4_clone_file_range()
    nfsd: Update the boot verifier on stable writes too.
    nfsd: Fix stable writes
    nfsd: Allow nfsd_vfs_write() to take the nfsd_file as an argument
    nfsd: Fix a soft lockup race in nfsd_file_mark_find_or_create()
    nfsd: Reduce the number of calls to nfsd_file_gc()
    nfsd: Schedule the laundrette regularly irrespective of file errors
    nfsd: Remove unused constant NFSD_FILE_LRU_RESCAN
    nfsd: Containerise filecache laundrette
    ...

    Linus Torvalds
     

04 Feb, 2020

1 commit

  • The most notable change is DEFINE_SHOW_ATTRIBUTE macro split in
    seq_file.h.

    Conversion rule is:

    llseek => proc_lseek
    unlocked_ioctl => proc_ioctl

    xxx => proc_xxx

    delete ".owner = THIS_MODULE" line

    [akpm@linux-foundation.org: fix drivers/isdn/capi/kcapi_proc.c]
    [sfr@canb.auug.org.au: fix kernel/sched/psi.c]
    Link: http://lkml.kernel.org/r/20200122180545.36222f50@canb.auug.org.au
    Link: http://lkml.kernel.org/r/20191225172546.GB13378@avx2
    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

20 Dec, 2019

1 commit

  • A couple of time_t variables are only used to track the state of the
    lease time and its expiration. The code correctly uses the 'time_after()'
    macro to make this work on 32-bit architectures even beyond year 2038,
    but the get_seconds() function and the time_t type itself are deprecated
    as they behave inconsistently between 32-bit and 64-bit architectures
    and often lead to code that is not y2038 safe.

    As a minor issue, using get_seconds() leads to problems with concurrent
    settimeofday() or clock_settime() calls, in the worst case timeout never
    triggering after the time has been set backwards.

    Change nfsd to use time64_t and ktime_get_boottime_seconds() here. This
    is clearly excessive, as boottime by itself means we never go beyond 32
    bits, but it does mean we handle this correctly and consistently without
    having to worry about corner cases and should be no more expensive than
    the previous implementation on 64-bit architectures.

    The max_cb_time() function gets changed in order to avoid an expensive
    64-bit division operation, but as the lease time is at most one hour,
    there is no change in behavior.

    Also do the same for server-to-server copy expiration time.

    Signed-off-by: Arnd Bergmann
    [bfields@redhat.com: fix up copy expiration]
    Signed-off-by: J. Bruce Fields

    Arnd Bergmann
     

28 Sep, 2019

1 commit

  • Pull nfsd updates from Bruce Fields:
    "Highlights:

    - Add a new knfsd file cache, so that we don't have to open and close
    on each (NFSv2/v3) READ or WRITE. This can speed up read and write
    in some cases. It also replaces our readahead cache.

    - Prevent silent data loss on write errors, by treating write errors
    like server reboots for the purposes of write caching, thus forcing
    clients to resend their writes.

    - Tweak the code that allocates sessions to be more forgiving, so
    that NFSv4.1 mounts are less likely to hang when a server already
    has a lot of clients.

    - Eliminate an arbitrary limit on NFSv4 ACL sizes; they should now be
    limited only by the backend filesystem and the maximum RPC size.

    - Allow the server to enforce use of the correct kerberos credentials
    when a client reclaims state after a reboot.

    And some miscellaneous smaller bugfixes and cleanup"

    * tag 'nfsd-5.4' of git://linux-nfs.org/~bfields/linux: (34 commits)
    sunrpc: clean up indentation issue
    nfsd: fix nfs read eof detection
    nfsd: Make nfsd_reset_boot_verifier_locked static
    nfsd: degraded slot-count more gracefully as allocation nears exhaustion.
    nfsd: handle drc over-allocation gracefully.
    nfsd: add support for upcall version 2
    nfsd: add a "GetVersion" upcall for nfsdcld
    nfsd: Reset the boot verifier on all write I/O errors
    nfsd: Don't garbage collect files that might contain write errors
    nfsd: Support the server resetting the boot verifier
    nfsd: nfsd_file cache entries should be per net namespace
    nfsd: eliminate an unnecessary acl size limit
    Deprecate nfsd fault injection
    nfsd: remove duplicated include from filecache.c
    nfsd: Fix the documentation for svcxdr_tmpalloc()
    nfsd: Fix up some unused variable warnings
    nfsd: close cached files prior to a REMOVE or RENAME that would replace target
    nfsd: rip out the raparms cache
    nfsd: have nfsd_test_lock use the nfsd_file cache
    nfsd: hook up nfs4_preprocess_stateid_op to the nfsd_file cache
    ...

    Linus Torvalds
     

19 Sep, 2019

1 commit

  • Pull vfs mount API infrastructure updates from Al Viro:
    "Infrastructure bits of mount API conversions.

    The rest is more of per-filesystem updates and that will happen
    in separate pull requests"

    * 'work.mount-base' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    mtd: Provide fs_context-aware mount_mtd() replacement
    vfs: Create fs_context-aware mount_bdev() replacement
    new helper: get_tree_keyed()
    vfs: set fs_context::user_ns for reconfigure

    Linus Torvalds
     

10 Sep, 2019

1 commit


06 Sep, 2019

1 commit


16 Aug, 2019

3 commits

  • A process could race in an open and attempt to read one of these files
    before i_private is initialized, and get a spurious error.

    Reported-by: Al Viro
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • synchronize_rcu() gets called multiple times each time a client is
    destroyed. If the laundromat thread has a lot of clients to destroy,
    the delay can be noticeable. This was causing pynfs test RENEW3 to
    fail.

    We could embed an rcu_head in each inode and do the kref_put in an rcu
    callback. But simplest is just to take a lock here.

    (I also wonder if the laundromat thread would be better replaced by a
    bunch of scheduled work or timers or something.)

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • syzbot is reporting that nfsd_mkdir() forgot to remove dentry created by
    d_alloc_name() when __nfsd_mkdir() failed (due to memory allocation fault
    injection) [1].

    [1] https://syzkaller.appspot.com/bug?id=ce41a1f769ea4637ebffedf004a803e8405b4674

    Signed-off-by: Tetsuo Handa
    Reported-by: syzbot
    Fixes: e8a79fb14f6b76b5 ("nfsd: add nfsd/clients directory")
    [bfields: clean up in nfsd_mkdir instead of __nfsd_mkdir]
    Signed-off-by: J. Bruce Fields

    Tetsuo Handa
     

20 Jul, 2019

1 commit

  • Pull vfs mount updates from Al Viro:
    "The first part of mount updates.

    Convert filesystems to use the new mount API"

    * 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits)
    mnt_init(): call shmem_init() unconditionally
    constify ksys_mount() string arguments
    don't bother with registering rootfs
    init_rootfs(): don't bother with init_ramfs_fs()
    vfs: Convert smackfs to use the new mount API
    vfs: Convert selinuxfs to use the new mount API
    vfs: Convert securityfs to use the new mount API
    vfs: Convert apparmorfs to use the new mount API
    vfs: Convert openpromfs to use the new mount API
    vfs: Convert xenfs to use the new mount API
    vfs: Convert gadgetfs to use the new mount API
    vfs: Convert oprofilefs to use the new mount API
    vfs: Convert ibmasmfs to use the new mount API
    vfs: Convert qib_fs/ipathfs to use the new mount API
    vfs: Convert efivarfs to use the new mount API
    vfs: Convert configfs to use the new mount API
    vfs: Convert binfmt_misc to use the new mount API
    convenience helper: get_tree_single()
    convenience helper get_tree_nodev()
    vfs: Kill sget_userns()
    ...

    Linus Torvalds
     

13 Jul, 2019

1 commit

  • Pull driver core and debugfs updates from Greg KH:
    "Here is the "big" driver core and debugfs changes for 5.3-rc1

    It's a lot of different patches, all across the tree due to some api
    changes and lots of debugfs cleanups.

    Other than the debugfs cleanups, in this set of changes we have:

    - bus iteration function cleanups

    - scripts/get_abi.pl tool to display and parse Documentation/ABI
    entries in a simple way

    - cleanups to Documenatation/ABI/ entries to make them parse easier
    due to typos and other minor things

    - default_attrs use for some ktype users

    - driver model documentation file conversions to .rst

    - compressed firmware file loading

    - deferred probe fixes

    All of these have been in linux-next for a while, with a bunch of
    merge issues that Stephen has been patient with me for"

    * tag 'driver-core-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (102 commits)
    debugfs: make error message a bit more verbose
    orangefs: fix build warning from debugfs cleanup patch
    ubifs: fix build warning after debugfs cleanup patch
    driver: core: Allow subsystems to continue deferring probe
    drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT
    arch_topology: Remove error messages on out-of-memory conditions
    lib: notifier-error-inject: no need to check return value of debugfs_create functions
    swiotlb: no need to check return value of debugfs_create functions
    ceph: no need to check return value of debugfs_create functions
    sunrpc: no need to check return value of debugfs_create functions
    ubifs: no need to check return value of debugfs_create functions
    orangefs: no need to check return value of debugfs_create functions
    nfsd: no need to check return value of debugfs_create functions
    lib: 842: no need to check return value of debugfs_create functions
    debugfs: provide pr_fmt() macro
    debugfs: log errors when something goes wrong
    drivers: s390/cio: Fix compilation warning about const qualifiers
    drivers: Add generic helper to match by of_node
    driver_find_device: Unify the match function with class_find_device()
    bus_find_device: Unify the match callback with class_find_device
    ...

    Linus Torvalds
     

10 Jul, 2019

1 commit


04 Jul, 2019

5 commits


03 Jul, 2019

1 commit

  • When calling debugfs functions, there is no need to ever check the
    return value. The function can work or not, but the code logic should
    never do something different based on this.

    Cc: "J. Bruce Fields"
    Cc: Jeff Layton
    Cc: linux-nfs@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman
    Link: https://lore.kernel.org/r/20190612152603.GB18440@kroah.com
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

26 May, 2019

1 commit

  • Convert the nfsctl filesystem to the new internal mount API as the old
    one will be obsoleted and removed. This allows greater flexibility in
    communication of mount parameters between userspace, the VFS and the
    filesystem.

    See Documentation/filesystems/mount_api.txt for more information.

    Signed-off-by: David Howells
    cc: "J. Bruce Fields"
    cc: Jeff Layton
    cc: linux-nfs@vger.kernel.org

    David Howells
     

21 May, 2019

1 commit

  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have MODULE_LICENCE("GPL*") inside which was used in the initial
    scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

24 Apr, 2019

3 commits


13 Mar, 2019

1 commit

  • Pull NFS server updates from Bruce Fields:
    "Miscellaneous NFS server fixes.

    Probably the most visible bug is one that could artificially limit
    NFSv4.1 performance by limiting the number of oustanding rpcs from a
    single client.

    Neil Brown also gets a special mention for fixing a 14.5-year-old
    memory-corruption bug in the encoding of NFSv3 readdir responses"

    * tag 'nfsd-5.1' of git://linux-nfs.org/~bfields/linux:
    nfsd: allow nfsv3 readdir request to be larger.
    nfsd: fix wrong check in write_v4_end_grace()
    nfsd: fix memory corruption caused by readdir
    nfsd: fix performance-limiting session calculation
    svcrpc: fix UDP on servers with lots of threads
    svcrdma: Remove syslog warnings in work completion handlers
    svcrdma: Squelch compiler warning when SUNRPC_DEBUG is disabled
    svcrdma: Use struct_size() in kmalloc()
    svcrpc: fix unlikely races preventing queueing of sockets
    svcrpc: svc_xprt_has_something_to_do seems a little long
    SUNRPC: Don't allow compiler optimisation of svc_xprt_release_slot()
    nfsd: fix an IS_ERR() vs NULL check

    Linus Torvalds
     

06 Mar, 2019

1 commit

  • Commit 62a063b8e7d1 "nfsd4: fix crash on writing v4_end_grace before
    nfsd startup" is trying to fix a NULL dereference issue, but it
    mistakenly checks if the nfsd server is started. So fix it.

    Fixes: 62a063b8e7d1 "nfsd4: fix crash on writing v4_end_grace before nfsd startup"
    Cc: stable@vger.kernel.org
    Reviewed-by: Joseph Qi
    Signed-off-by: Yihao Wu
    Signed-off-by: J. Bruce Fields

    Yihao Wu
     

15 Feb, 2019

1 commit

  • This reverts commit d6ebf5088f09472c1136cd506bdc27034a6763f8.

    I forgot that the kernel's default lease period should never be
    decreased!

    After a kernel upgrade, the kernel has no way of knowing on its own what
    the previous lease time was. Unless userspace tells it otherwise, it
    will assume the previous lease period was the same.

    So if we decrease this value in a kernel upgrade, we end up enforcing a
    grace period that's too short, and clients will fail to reclaim state in
    time. Symptoms may include EIO and log messages like "NFS:
    nfs4_reclaim_open_state: Lock reclaim failed!"

    There was no real justification for the lease period decrease anyway.

    Reported-by: Donald Buczek
    Fixes: d6ebf5088f09 "nfsd4: return default lease period"
    Cc: stable@vger.kernel.org
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

29 Nov, 2018

1 commit

  • Anatoly Trosinenko reports that this:

    1) Checkout fresh master Linux branch (tested with commit e195ca6cb)
    2) Copy x84_64-config-4.14 to .config, then enable NFS server v4 and build
    3) From `kvm-xfstests shell`:

    results in NULL dereference in locks_end_grace.

    Check that nfsd has been started before trying to end the grace period.

    Reported-by: Anatoly Trosinenko
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

26 Sep, 2018

1 commit

  • Upon receiving a request for async copy, create a new kthread. If we
    get asynchronous request, make sure to copy the needed arguments/state
    from the stack before starting the copy. Then start the thread and reply
    back to the client indicating copy is asynchronous.

    nfsd_copy_file_range() will copy in a loop over the total number of
    bytes is needed to copy. In case a failure happens in the middle, we
    ignore the error and return how much we copied so far. Once done
    creating a workitem for the callback workqueue and send CB_OFFLOAD with
    the results.

    The lifetime of the copy stateid is bound to the vfs copy. This way we
    don't need to keep the nfsd_net structure for the callback. We could
    keep it around longer so that an OFFLOAD_STATUS that came late would
    still get results, but clients should be able to deal without that.

    We handle OFFLOAD_CANCEL by sending a signal to the copy thread and
    calling kthread_stop.

    A client should cancel any ongoing copies before calling DESTROY_CLIENT;
    if not, we return a CLIENT_BUSY error.

    If the client is destroyed for some other reason (lease expiration, or
    server shutdown), we must clean up any ongoing copies ourselves.

    Signed-off-by: Olga Kornievskaia
    [colin.king@canonical.com: fix leak in error case]
    [bfields@fieldses.org: remove signalling, merge patches]
    Signed-off-by: J. Bruce Fields

    Olga Kornievskaia
     

10 Aug, 2018

1 commit


17 Jun, 2018

2 commits

  • I don't have a good rationale for the lease period, but 90 seconds seems
    long, and as long as we're allowing the server to extend the grace
    period up to double the lease period, let's half the default to 45.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • If the client is only renewing state a little sooner than once a lease
    period, then it might not discover the server has restarted till close
    to the end of the grace period, and might run out of time to do the
    actual reclaim.

    Extend the grace period by a second each time we notice there are
    clients still trying to reclaim, up to a limit of another whole lease
    period.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields