1. 24 May, 2022 3 commits
    • Andrew Price's avatar
      gfs2: Return more useful errors from gfs2_rgrp_send_discards() · f4a47561
      Andrew Price authored
      The bug that 27ca8273 ("gfs2: Make sure FITRIM minlen is rounded up to
      fs block size") fixes was a little confusing as the user saw
      "Input/output error" which masked the -EINVAL that sb_issue_discard()
      returned.
      
      sb_issue_discard() can fail for various reasons, so we should return its
      return value from gfs2_rgrp_send_discards() to avoid all errors being
      reported as IO errors.
      
      This improves error reporting for FITRIM and makes no difference to the
      -o discard code path because the return value from
      gfs2_rgrp_send_discards() gets thrown away in that case (and the option
      switches off). Presumably that's why it was ok to just return -EIO in
      the past, before FITRIM was implemented.
      
      Tested with xfstests.
      Signed-off-by: default avatarAndrew Price <anprice@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      f4a47561
    • Kees Cook's avatar
      gfs2: Use container_of() for gfs2_glock(aspace) · 11d8b79e
      Kees Cook authored
      Clang's structure layout randomization feature gets upset when it sees
      struct address_space (which is randomized) cast to struct gfs2_glock.
      This is due to seeing the mapping pointer as being treated as an array
      of gfs2_glock, rather than "something else, before struct address_space":
      
      In file included from fs/gfs2/acl.c:23:
      fs/gfs2/meta_io.h:44:12: error: casting from randomized structure pointer type 'struct address_space *' to 'struct gfs2_glock *'
      	return (((struct gfs2_glock *)mapping) - 1)->gl_name.ln_sbd;
      		^
      
      Replace the instances of open-coded pointer math with container_of()
      usage, and update the allocator to match.
      
      Some cleanups and conversion of gfs2_glock_get() and
      gfs2_glock_dealloc() by Andreas.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Link: https://lore.kernel.org/lkml/202205041550.naKxwCBj-lkp@intel.com
      Cc: Bob Peterson <rpeterso@redhat.com>
      Cc: Andreas Gruenbacher <agruenba@redhat.com>
      Cc: Bill Wendling <morbo@google.com>
      Cc: cluster-devel@redhat.com
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      11d8b79e
    • Andreas Gruenbacher's avatar
      gfs2: Explain some direct I/O oddities · 53bb540f
      Andreas Gruenbacher authored
      Add some comments explaining the oddities of partial direct I/O reads
      and writes.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      53bb540f
  2. 14 May, 2022 1 commit
  3. 13 May, 2022 16 commits
    • Linus Torvalds's avatar
      Merge tag 'gfs2-v5.18-rc4-fix3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · d928e8f3
      Linus Torvalds authored
      Pull gfs2 fixes from Andreas Gruenbacher:
       "We've finally identified commit dc732906 ("gfs2: Introduce flag
        for glock holder auto-demotion") to be the other cause of the
        filesystem corruption we've been seeing. This feature isn't strictly
        necessary anymore, so we've decided to stop using it for now.
      
        With this and the gfs_iomap_end rounding fix you've already seen
        ("gfs2: Fix filesystem block deallocation for short writes" in this
        pull request), we're corruption free again now.
      
         - Fix filesystem block deallocation for short writes.
      
         - Stop using glock holder auto-demotion for now.
      
         - Get rid of buffered writes inefficiencies due to page faults being
           disabled.
      
         - Minor other cleanups"
      
      * tag 'gfs2-v5.18-rc4-fix3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Stop using glock holder auto-demotion for now
        gfs2: buffered write prefaulting
        gfs2: Align read and write chunks to the page cache
        gfs2: Pull return value test out of should_fault_in_pages
        gfs2: Clean up use of fault_in_iov_iter_{read,write}able
        gfs2: Variable rename
        gfs2: Fix filesystem block deallocation for short writes
      d928e8f3
    • Andreas Gruenbacher's avatar
      gfs2: Stop using glock holder auto-demotion for now · e1fa9ea8
      Andreas Gruenbacher authored
      We're having unresolved issues with the glock holder auto-demotion mechanism
      introduced in commit dc732906.  This mechanism was assumed to be essential
      for avoiding frequent short reads and writes until commit 296abc0d
      ("gfs2: No short reads or writes upon glock contention").  Since then,
      when the inode glock is lost, it is simply re-acquired and the operation
      is resumed.  This means that apart from the performance penalty, we
      might as well drop the inode glock before faulting in pages, and
      re-acquire it afterwards.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      e1fa9ea8
    • Andreas Gruenbacher's avatar
      gfs2: buffered write prefaulting · fa5dfa64
      Andreas Gruenbacher authored
      In gfs2_file_buffered_write, to increase the likelihood that all the
      user memory we're trying to write will be resident in memory, carry out
      the write in chunks and fault in each chunk of user memory before trying
      to write it.  Otherwise, some workloads will trigger frequent short
      "internal" writes, causing filesystem blocks to be allocated and then
      partially deallocated again when writing into holes, which is wasteful
      and breaks reservations.
      
      Neither the chunked writes nor any of the short "internal" writes are
      user visible.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      fa5dfa64
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · f2dd0074
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Four fixes, all in drivers.
      
        These patches mosly fix error legs and exceptional conditions
        (scsi_dh_alua, qla2xxx). The lpfc fixes are for coding issues with
        lpfc features"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: lpfc: Correct BDE DMA address assignment for GEN_REQ_WQE
        scsi: lpfc: Fix split code for FLOGI on FCoE
        scsi: qla2xxx: Fix missed DMA unmap for aborted commands
        scsi: scsi_dh_alua: Properly handle the ALUA transitioning state
      f2dd0074
    • Andreas Gruenbacher's avatar
      gfs2: Align read and write chunks to the page cache · 324d116c
      Andreas Gruenbacher authored
      Align the chunks that reads and writes are carried out in to the page
      cache rather than the user buffers.  This will be more efficient in
      general, especially for allocating writes.  Optimizing the case that the
      user buffer is gfs2 backed isn't very useful; we only need to make sure
      we won't deadlock.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      324d116c
    • Andreas Gruenbacher's avatar
      gfs2: Pull return value test out of should_fault_in_pages · 72382264
      Andreas Gruenbacher authored
      Pull the return value test of the previous read or write operation out
      of should_fault_in_pages().  In a following patch, we'll fault in pages
      before the I/O and there will be no return value to check.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      72382264
    • Andreas Gruenbacher's avatar
      gfs2: Clean up use of fault_in_iov_iter_{read,write}able · 6d22ff47
      Andreas Gruenbacher authored
      No need to store the return value of the fault_in functions in separate
      variables.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      6d22ff47
    • Andreas Gruenbacher's avatar
      gfs2: Variable rename · 42e4c3bd
      Andreas Gruenbacher authored
      Instead of counting the number of bytes read from the filesystem,
      functions gfs2_file_direct_read and gfs2_file_read_iter count the number
      of bytes written into the user buffer.  Conversely, functions
      gfs2_file_direct_write and gfs2_file_buffered_write count the number of
      bytes read from the user buffer.  This is nothing but confusing, so
      change the read functions to count how many bytes they have read, and
      the write functions to count how many bytes they have written.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      42e4c3bd
    • Andreas Gruenbacher's avatar
      gfs2: Fix filesystem block deallocation for short writes · d031a886
      Andreas Gruenbacher authored
      When a write cannot be carried out in full, gfs2_iomap_end() releases
      blocks that have been allocated for this write but haven't been used.
      
      To compute the end of the allocation, gfs2_iomap_end() incorrectly
      rounded the end of the attempted write down to the next block boundary
      to arrive at the end of the allocation.  It would have to round up, but
      the end of the allocation is also available as iomap->offset +
      iomap->length, so just use that instead.
      
      In addition, use round_up() for computing the start of the unused range.
      
      Fixes: 64bc06bb ("gfs2: iomap buffered write support")
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      d031a886
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-5.18-rc7' of https://github.com/ceph/ceph-client · c3f5e692
      Linus Torvalds authored
      Pull ceph fix from Ilya Dryomov:
       "Two fixes to properly maintain xattrs on async creates and thus
        preserve SELinux context on newly created files and to avoid improper
        usage of folio->private field which triggered BUG_ONs.
      
        Both marked for stable"
      
      * tag 'ceph-for-5.18-rc7' of https://github.com/ceph/ceph-client:
        ceph: check folio PG_private bit instead of folio->private
        ceph: fix setting of xattrs on async created inodes
      c3f5e692
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.18-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 6dd5884d
      Linus Torvalds authored
      Pull NFS client bugfixes from Trond Myklebust:
       "One more pull request. There was a bug in the fix to ensure that gss-
        proxy continues to work correctly after we fixed the AF_LOCAL socket
        leak in the RPC code. This therefore reverts that broken patch, and
        replaces it with one that works correctly.
      
        Stable fixes:
      
         - SUNRPC: Ensure that the gssproxy client can start in a connected
           state
      
        Bugfixes:
      
         - Revert "SUNRPC: Ensure gss-proxy connects on setup"
      
         - nfs: fix broken handling of the softreval mount option"
      
      * tag 'nfs-for-5.18-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        nfs: fix broken handling of the softreval mount option
        SUNRPC: Ensure that the gssproxy client can start in a connected state
        Revert "SUNRPC: Ensure gss-proxy connects on setup"
      6dd5884d
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm · 364a453a
      Linus Torvalds authored
      Pull misc fixes from Andrew Morton:
       "Seven MM fixes, three of which address issues added in the most recent
        merge window, four of which are cc:stable.
      
        Three non-MM fixes, none very serious"
      
      [ And yes, that's a real pull request from Andrew, not me creating a
        branch from emailed patches. Woo-hoo! ]
      
      * tag 'mm-hotfixes-stable-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        MAINTAINERS: add a mailing list for DAMON development
        selftests: vm: Makefile: rename TARGETS to VMTARGETS
        mm/kfence: reset PG_slab and memcg_data before freeing __kfence_pool
        mailmap: add entry for martyna.szapar-mudlaw@intel.com
        arm[64]/memremap: don't abuse pfn_valid() to ensure presence of linear map
        procfs: prevent unprivileged processes accessing fdinfo dir
        mm: mremap: fix sign for EFAULT error return value
        mm/hwpoison: use pr_err() instead of dump_page() in get_any_page()
        mm/huge_memory: do not overkill when splitting huge_zero_page
        Revert "mm/memory-failure.c: skip huge_zero_page in memory_failure()"
      364a453a
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 91bdba85
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
      
       - TLB invalidation workaround for Qualcomm Kryo-4xx "gold" CPUs
      
       - Fix broken dependency in the vDSO Makefile
      
       - Fix pointer authentication overrides in ISAR2 ID register
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Enable repeat tlbi workaround on KRYO4XX gold CPUs
        arm64: cpufeature: remove duplicate ID_AA64ISAR2_EL1 entry
        arm64: vdso: fix makefile dependency on vdso.so
      91bdba85
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.18-rc7' of... · 359ee4f4
      Linus Torvalds authored
      Merge tag 'hwmon-for-v5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - Restrict ltq-cputemp to SOC_XWAY to fix build failure
      
       - Add OF device ID table to tmp401 driver to enable auto-load
      
      * tag 'hwmon-for-v5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (ltq-cputemp) restrict it to SOC_XWAY
        hwmon: (tmp401) Add OF device ID table
      359ee4f4
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2022-05-13' of git://anongit.freedesktop.org/drm/drm · 10b4b67a
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Pretty quiet week on the fixes front, 4 amdgpu and one i915 fix.
      
        I think there might be a few misc fbdev ones outstanding, but I'll see
        if they are necessary and pass them on if so.
      
        amdgpu:
      
         - Disable ASPM for VI boards on ADL platforms
      
         - S0ix DCN3.1 display fix
      
         - Resume regression fix
      
         - Stable pstate fix
      
        i915:
      
         - fix for kernel memory corruption when running a lot of OpenCL tests
           in parallel"
      
      * tag 'drm-fixes-2022-05-13' of git://anongit.freedesktop.org/drm/drm:
        drm/amdgpu/ctx: only reset stable pstate if the user changed it (v2)
        Revert "drm/amd/pm: keep the BACO feature enabled for suspend"
        drm/i915: Fix race in __i915_vma_remove_closed
        drm/amd/display: undo clearing of z10 related function pointers
        drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems
      10b4b67a
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-5.18-2022-05-11' of... · 5005e981
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-5.18-2022-05-11' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
      
      amd-drm-fixes-5.18-2022-05-11:
      
      amdgpu:
      - Disable ASPM for VI boards on ADL platforms
      - S0ix DCN3.1 display fix
      - Resume regression fix
      - Stable pstate fix
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220511174422.5769-1-alexander.deucher@amd.com
      5005e981
  4. 12 May, 2022 16 commits
  5. 11 May, 2022 4 commits