1. 22 Sep, 2021 8 commits
  2. 21 Sep, 2021 6 commits
  3. 20 Sep, 2021 9 commits
    • Linus Torvalds's avatar
      Merge tag 'afs-fixes-20210913' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · d9fb6784
      Linus Torvalds authored
      Pull AFS fixes from David Howells:
       "Fixes for AFS problems that can cause data corruption due to
        interaction with another client modifying data cached locally:
      
         - When d_revalidating a dentry, don't look at the inode to which it
           points. Only check the directory to which the dentry belongs. This
           was confusing things and causing the silly-rename cleanup code to
           remove the file now at the dentry of a file that got deleted.
      
         - Fix mmap data coherency. When a callback break is received that
           relates to a file that we have cached, the data content may have
           been changed (there are other reasons, such as the user's rights
           having been changed). However, we're checking it lazily, only on
           entry to the kernel, which doesn't happen if we have a writeable
           shared mapped page on that file.
      
           We make the kernel keep track of mmapped files and clear all PTEs
           mapping to that file as soon as the callback comes in by calling
           unmap_mapping_pages() (we don't necessarily want to zap the
           pagecache). This causes the kernel to be reentered when userspace
           tries to access the mmapped address range again - and at that point
           we can query the server and, if we need to, zap the page cache.
      
           Ideally, I would check each file at the point of notification, but
           that involves poking the server[*] - which is holding an exclusive
           lock on the vnode it is changing, waiting for all the clients it
           notified to reply. This could then deadlock against the server.
           Further, invalidating the pagecache might call ->launder_page(),
           which would try to write to the file, which would definitely
           deadlock. (AFS doesn't lease file access).
      
           [*] Checking to see if the file content has changed is a matter of
               comparing the current data version number, but we have to ask
               the server for that. We also need to get a new callback promise
               and we need to poke the server for that too.
      
         - Add some more points at which the inode is validated, since we're
           doing it lazily, notably in ->read_iter() and ->page_mkwrite(), but
           also when performing some directory operations.
      
           Ideally, checking in ->read_iter() would be done in some derivation
           of filemap_read(). If we're going to call the server to read the
           file, then we get the file status fetch as part of that.
      
         - The above is now causing us to make a lot more calls to
           afs_validate() to check the inode - and afs_validate() takes the
           RCU read lock each time to make a quick check (ie.
           afs_check_validity()). This is entirely for the purpose of checking
           cb_s_break to see if the server we're using reinitialised its list
           of callbacks - however this isn't a very common event, so most of
           the time we're taking this needlessly.
      
           Add a new cell-wide counter to count the number of
           reinitialisations done by any server and check that - and only if
           that changes, take the RCU read lock and check the server list (the
           server list may change, but the cell a file is part of won't).
      
         - Don't update vnode->cb_s_break and ->cb_v_break inside the validity
           checking loop. The cb_lock is done with read_seqretry, so we might
           go round the loop a second time after resetting those values - and
           that could cause someone else checking validity to miss something
           (I think).
      
        Also included are patches for fixes for some bugs encountered whilst
        debugging this:
      
         - Fix a leak of afs_read objects and fix a leak of keys hidden by
           that.
      
         - Fix a leak of pages that couldn't be added to extend a writeback.
      
         - Fix the maintenance of i_blocks when i_size is changed by a local
           write or a local dir edit"
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=214217 [1]
      Link: https://lore.kernel.org/r/163111665183.283156.17200205573146438918.stgit@warthog.procyon.org.uk/ # v1
      Link: https://lore.kernel.org/r/163113612442.352844.11162345591911691150.stgit@warthog.procyon.org.uk/ # i_blocks patch
      
      * tag 'afs-fixes-20210913' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        afs: Fix updating of i_blocks on file/dir extension
        afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server
        afs: Try to avoid taking RCU read lock when checking vnode validity
        afs: Fix mmap coherency vs 3rd-party changes
        afs: Fix incorrect triggering of sillyrename on 3rd-party invalidation
        afs: Add missing vnode validation checks
        afs: Fix page leak
        afs: Fix missing put on afs_read objects and missing get on the key therein
      d9fb6784
    • Linus Torvalds's avatar
      Merge tag '5.15-rc1-ksmbd' of git://git.samba.org/ksmbd · 707a63e9
      Linus Torvalds authored
      Pull ksmbd server fixes from Steve French:
       "Three ksmbd fixes, including an important security fix for path
        processing, and a buffer overflow check, and a trivial fix for
        incorrect header inclusion"
      
      * tag '5.15-rc1-ksmbd' of git://git.samba.org/ksmbd:
        ksmbd: add validation for FILE_FULL_EA_INFORMATION of smb2_get_info
        ksmbd: prevent out of share access
        ksmbd: transport_rdma: Don't include rwlock.h directly
      707a63e9
    • Linus Torvalds's avatar
      Merge tag '5.15-rc1-smb3' of git://git.samba.org/sfrench/cifs-2.6 · fdf50784
      Linus Torvalds authored
      Pull cifs client fixes from Steve French:
      
       - two deferred close fixes (for bugs found with xfstests 478 and 461)
      
       - a deferred close improvement in rename
      
       - two trivial fixes for incorrect Linux comment formatting of multiple
         cifs files (pointed out by automated kernel test robot and
         checkpatch)
      
      * tag '5.15-rc1-smb3' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Not to defer close on file when lock is set
        cifs: Fix soft lockup during fsstress
        cifs: Deferred close performance improvements
        cifs: fix incorrect kernel doc comments
        cifs: remove pathname for file from SPDX header
      fdf50784
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 4c17ca27
      Linus Torvalds authored
      Pull spi fixes from Mark BrownL
       "This contains a couple of fixes, one fix for handling of zero length
        transfers on Rockchip devices and a warning fix which will conflict
        with a version you did but cleans up some extra unneeded forward
        declarations as well which seems a bit neater"
      
      * tag 'spi-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: tegra20-slink: Declare runtime suspend and resume functions conditionally
        spi: rockchip: handle zero length transfers without timing out
      4c17ca27
    • Linus Torvalds's avatar
      Merge tag 'regulator-fix-v5.15-rc2' of... · 2ff59bad
      Linus Torvalds authored
      Merge tag 'regulator-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
      
      Pull regulator fixes from Mark Brown:
       "A couple of small device specific fixes that have been sent since the
        merge window, neither of which stands out particularly"
      
      * tag 'regulator-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: max14577: Revert "regulator: max14577: Add proper module aliases strings"
        regulator: qcom-rpmh-regulator: fix pm8009-1 ldo7 resource name
      2ff59bad
    • Guenter Roeck's avatar
      drm/nouveau/nvkm: Replace -ENOSYS with -ENODEV · e8f71f89
      Guenter Roeck authored
      nvkm test builds fail with the following error.
      
        drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c: In function 'nvkm_control_mthd_pstate_info':
        drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c:60:35: error: overflow in conversion from 'int' to '__s8' {aka 'signed char'} changes value from '-251' to '5'
      
      The code builds on most architectures, but fails on parisc where ENOSYS
      is defined as 251.
      
      Replace the error code with -ENODEV (-19).  The actual error code does
      not really matter and is not passed to userspace - it just has to be
      negative.
      
      Fixes: 7238eca4 ("drm/nouveau: expose pstate selection per-power source in sysfs")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e8f71f89
    • Linus Torvalds's avatar
      sparc64: fix pci_iounmap() when CONFIG_PCI is not set · d8b1e10a
      Linus Torvalds authored
      Guenter reported [1] that the pci_iounmap() changes remain problematic,
      with sparc64 allnoconfig and tinyconfig still not building due to the
      header file changes and confusion with the arch-specific pci_iounmap()
      implementation.
      
      I'm pretty convinced that sparc should just use GENERIC_IOMAP instead of
      doing its own thing, since it turns out that the sparc64 version of
      pci_iounmap() is somewhat buggy (see [2]).  But in the meantime, this
      just fixes the build by avoiding the trivial re-definition of the empty
      case.
      
      Link: https://lore.kernel.org/lkml/20210920134424.GA346531@roeck-us.net/ [1]
      Link: https://lore.kernel.org/lkml/CAHk-=wgheheFx9myQyy5osh79BAazvmvYURAtub2gQtMvLrhqQ@mail.gmail.com/ [2]
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d8b1e10a
    • Linus Torvalds's avatar
      Linux 5.15-rc2 · e4e737bb
      Linus Torvalds authored
      e4e737bb
    • Linus Torvalds's avatar
      pci_iounmap'2: Electric Boogaloo: try to make sense of it all · 316e8d79
      Linus Torvalds authored
      Nathan Chancellor reports that the recent change to pci_iounmap in
      commit 9caea000 ("parisc: Declare pci_iounmap() parisc version only
      when CONFIG_PCI enabled") causes build errors on arm64.
      
      It took me about two hours to convince myself that I think I know what
      the logic of that mess of #ifdef's in the <asm-generic/io.h> header file
      really aim to do, and rewrite it to be easier to follow.
      
      Famous last words.
      
      Anyway, the code has now been lifted from that grotty header file into
      lib/pci_iomap.c, and has fairly extensive comments about what the logic
      is.  It also avoids indirecting through another confusing (and badly
      named) helper function that has other preprocessor config conditionals.
      
      Let's see what odd architecture did something else strange in this area
      to break things.  But my arm64 cross build is clean.
      
      Fixes: 9caea000 ("parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled")
      Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Ulrich Teichert <krypton@ulrich-teichert.org>
      Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      316e8d79
  4. 19 Sep, 2021 17 commits