1. 06 Nov, 2023 8 commits
  2. 02 Nov, 2023 4 commits
  3. 23 Oct, 2023 2 commits
  4. 03 Oct, 2023 2 commits
    • Al Viro's avatar
      gfs2: fix an oops in gfs2_permission · 0abd1557
      Al Viro authored
      In RCU mode, we might race with gfs2_evict_inode(), which zeroes
      ->i_gl.  Freeing of the object it points to is RCU-delayed, so
      if we manage to fetch the pointer before it's been replaced with
      NULL, we are fine.  Check if we'd fetched NULL and treat that
      as "bail out and tell the caller to get out of RCU mode".
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      0abd1557
    • Bob Peterson's avatar
      gfs2: ignore negated quota changes · 4c6a0812
      Bob Peterson authored
      When lots of quota changes are made, there may be cases in which an
      inode's quota information is increased and then decreased, such as when
      blocks are added to a file, then deleted from it. If the timing is
      right, function do_qc can add pending quota changes to a transaction,
      then later, another call to do_qc can negate those changes, resulting
      in a net gain of 0. The quota_change information is recorded in the qc
      buffer (and qd element of the inode as well). The buffer is added to the
      transaction by the first call to do_qc, but a subsequent call changes
      the value from non-zero back to zero. At that point it's too late to
      remove the buffer_head from the transaction. Later, when the quota sync
      code is called, the zero-change qd element is discovered and flagged as
      an assert warning. If the fs is mounted with errors=panic, the kernel
      will panic.
      
      This is usually seen when files are truncated and the quota changes are
      negated by punch_hole/truncate which uses gfs2_quota_hold and
      gfs2_quota_unhold rather than block allocations that use gfs2_quota_lock
      and gfs2_quota_unlock which automatically do quota sync.
      
      This patch solves the problem by adding a check to qd_check_sync such
      that net-zero quota changes already added to the transaction are no
      longer deemed necessary to be synced, and skipped.
      
      In this case references are taken for the qd and the slot from do_qc
      so those need to be put. The normal sequence of events for a normal
      non-zero quota change is as follows:
      
      gfs2_quota_change
         do_qc
            qd_hold
            slot_hold
      
      Later, when the changes are to be synced:
      
      gfs2_quota_sync
         qd_fish
            qd_check_sync
               gets qd ref via lockref_get_not_dead
         do_sync
            do_qc(QC_SYNC)
               qd_put
      	    lockref_put_or_lock
         qd_unlock
            qd_put
               lockref_put_or_lock
      
      In the net-zero change case, we add a check to qd_check_sync so it puts
      the qd and slot references acquired in gfs2_quota_change and skip the
      unneeded sync.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      4c6a0812
  5. 22 Sep, 2023 2 commits
  6. 18 Sep, 2023 7 commits
    • Andreas Gruenbacher's avatar
      gfs2: Remove unused gfs2_extent_length argument · b4bf3d5c
      Andreas Gruenbacher authored
      The limit argument of gfs2_extent_length() is unused.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      b4bf3d5c
    • Andreas Gruenbacher's avatar
      gfs2: Remove freeze_go_demote_ok · bbacb395
      Andreas Gruenbacher authored
      Before commit b77b4a48 ("gfs2: Rework freeze / thaw logic"), the
      freeze glock was kept around in the glock cache in shared mode without
      being actively held while a filesystem is in thawed state.  In that
      state, memory pressure could have eventually evicted the freeze glock,
      and the freeze_go_demote_ok callback was needed to prevent that from
      happening.
      
      With the freeze / thaw rework, the freeze glock is now always actively
      held in shared mode while a filesystem is thawed, and the
      freeze_go_demote_ok hack is no longer needed.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      bbacb395
    • Andreas Gruenbacher's avatar
      gfs2: Simplify function gfs2_upgrade_iopen_glock · 18c1db31
      Andreas Gruenbacher authored
      When trying to upgrade the iopen glock, gfs2_upgrade_iopen_glock() tries
      to take the iopen glock with the LM_FLAG_TRY_1CB flag set before trying
      to take it without the LM_FLAG_TRY or LM_FLAG_TRY_1CB flags set.  Both
      calls will cause the lock contention bast callbacks to be invoked
      throughout the cluster, and we really don't need them to be invoked
      twice.  Remove the first LM_FLAG_TRY_1CB call to eliminate unnecessary
      dlm traffic.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      18c1db31
    • Linus Torvalds's avatar
      Merge tag 'gfs2-v6.6-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · a49d273e
      Linus Torvalds authored
      Pull gfs2 fixes from Andreas Gruenbacher:
      
       - Fix another freeze/thaw hang
      
       - Fix glock cache shrinking
      
       - Fix the quota=quiet mount option
      
      * tag 'gfs2-v6.6-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Fix quota=quiet oversight
        gfs2: fix glock shrinker ref issues
        gfs2: Fix another freeze/thaw hang
      a49d273e
    • Bob Peterson's avatar
      gfs2: Fix quota=quiet oversight · fb95d536
      Bob Peterson authored
      Patch eef46ab7 introduced a new gfs2 quota=quiet mount option.
      Checks for the new option were added to quota.c, but a check in
      gfs2_quota_lock_check() was overlooked.  This patch adds the missing
      check.
      
      Fixes: eef46ab7 ("gfs2: Introduce new quota=quiet mount option")
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      fb95d536
    • Bob Peterson's avatar
      gfs2: fix glock shrinker ref issues · 62862485
      Bob Peterson authored
      Before this patch, function gfs2_scan_glock_lru would only try to free
      glocks that had a reference count of 0. But if the reference count ever
      got to 0, the glock should have already been freed.
      
      Shrinker function gfs2_dispose_glock_lru checks whether glocks on the
      LRU are demote_ok, and if so, tries to demote them. But that's only
      possible if the reference count is at least 1.
      
      This patch changes gfs2_scan_glock_lru so it will try to demote and/or
      dispose of glocks that have a reference count of 1 and which are either
      demotable, or are already unlocked.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      62862485
    • Andreas Gruenbacher's avatar
      gfs2: Fix another freeze/thaw hang · 52954b75
      Andreas Gruenbacher authored
      On a thawed filesystem, the freeze glock is held in shared mode.  In
      order to initiate a cluster-wide freeze, the node initiating the freeze
      drops the freeze glock and grabs it in exclusive mode.  The other nodes
      recognize this as contention on the freeze glock; function
      freeze_go_callback is invoked.  This indicates to them that they must
      freeze the filesystem locally, drop the freeze glock, and then
      re-acquire it in shared mode before being able to unfreeze the
      filesystem locally.
      
      While a node is trying to re-acquire the freeze glock in shared mode,
      additional contention can occur.  In that case, the node must behave in
      the same way as above.
      
      Unfortunately, freeze_go_callback() contains a check that causes it to
      bail out when the freeze glock isn't held in shared mode.  Fix that to
      allow the glock to be unlocked or held in shared mode.
      
      In addition, update a reference to trylock_super() which has been
      renamed to super_trylock_shared() in the meantime.
      
      Fixes: b77b4a48 ("gfs2: Rework freeze / thaw logic")
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      52954b75
  7. 17 Sep, 2023 11 commits
  8. 16 Sep, 2023 4 commits
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.6' of... · f0b0d403
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Fix kernel-devel RPM and linux-headers Deb package
      
       - Fix too long argument list error in 'make modules_install'
      
      * tag 'kbuild-fixes-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: avoid long argument lists in make modules_install
        kbuild: fix kernel-devel RPM package and linux-headers Deb package
      f0b0d403
    • Linus Torvalds's avatar
      vm: fix move_vma() memory accounting being off · 3cec5049
      Linus Torvalds authored
      Commit 408579cd ("mm: Update do_vmi_align_munmap() return
      semantics") seems to have updated one of the callers of do_vmi_munmap()
      incorrectly: it used to check for the error case (which didn't
      change: negative means error).
      
      That commit changed the check to the success case (which did change:
      before that commit, 0 was success, and 1 was "success and lock
      downgraded".  After the change, it's always 0 for success, and the lock
      will have been released if requested).
      
      This didn't change any actual VM behavior _except_ for memory accounting
      when 'VM_ACCOUNT' was set on the vma.  Which made the wrong return value
      test fairly subtle, since everything continues to work.
      
      Or rather - it continues to work but the "Committed memory" accounting
      goes all wonky (Committed_AS value in /proc/meminfo), and depending on
      settings that then causes problems much much later as the VM relies on
      bogus statistics for its heuristics.
      
      Revert that one line of the change back to the original logic.
      
      Fixes: 408579cd ("mm: Update do_vmi_align_munmap() return semantics")
      Reported-by: default avatarChristoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
      Reported-bisected-and-tested-by: default avatarMichael Labiuk <michael.labiuk@virtuozzo.com>
      Cc: Bagas Sanjaya <bagasdotme@gmail.com>
      Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
      Link: https://lore.kernel.org/all/1694366957@msgid.manchmal.in-ulm.de/Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3cec5049
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · ad8a69f3
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "16 small(ish) fixes all in drivers.
      
        The major fixes are in pm8001 (fixes MSI-X issue going back to its
        origin), the qla2xxx endianness fix, which fixes a bug on big endian
        and the lpfc ones which can cause an oops on module removal without
        them"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: lpfc: Prevent use-after-free during rmmod with mapped NVMe rports
        scsi: lpfc: Early return after marking final NLP_DROPPED flag in dev_loss_tmo
        scsi: lpfc: Fix the NULL vs IS_ERR() bug for debugfs_create_file()
        scsi: target: core: Fix target_cmd_counter leak
        scsi: pm8001: Setup IRQs on resume
        scsi: pm80xx: Avoid leaking tags when processing OPC_INB_SET_CONTROLLER_CONFIG command
        scsi: pm80xx: Use phy-specific SAS address when sending PHY_START command
        scsi: ufs: core: Poll HCS.UCRDY before issuing a UIC command
        scsi: ufs: core: Move __ufshcd_send_uic_cmd() outside host_lock
        scsi: qedf: Add synchronization between I/O completions and abort
        scsi: target: Replace strlcpy() with strscpy()
        scsi: qla2xxx: Fix NULL vs IS_ERR() bug for debugfs_create_dir()
        scsi: qla2xxx: Use raw_smp_processor_id() instead of smp_processor_id()
        scsi: qla2xxx: Correct endianness for rqstlen and rsplen
        scsi: ppa: Fix accidentally reversed conditions for 16-bit and 32-bit EPP
        scsi: megaraid_sas: Fix deadlock on firmware crashdump
      ad8a69f3
    • Linus Torvalds's avatar
      Merge tag 'ata-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata · cc3e5afc
      Linus Torvalds authored
      Pull ata fixes from Damien Le Moal:
      
       - Fix link power management transitions to disallow unsupported states
         (Niklas)
      
       - A small string handling fix for the sata_mv driver (Christophe)
      
       - Clear port pending interrupts before reset, as per AHCI
         specifications (Szuying).
      
         Followup fixes for this one are to not clear ATA_PFLAG_EH_PENDING in
         ata_eh_reset() to allow EH to continue on with other actions recorded
         with error interrupts triggered before EH completes. And an
         additional fix to avoid thawing a port twice in EH (Niklas)
      
       - Small code style fixes in the pata_parport driver to silence the
         build bot as it keeps complaining about bad indentation (me)
      
       - A fix for the recent CDL code to avoid fetching sense data for
         successful commands when not necessary for correct operation (Niklas)
      
      * tag 'ata-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
        ata: libata-core: fetch sense data for successful commands iff CDL enabled
        ata: libata-eh: do not thaw the port twice in ata_eh_reset()
        ata: libata-eh: do not clear ATA_PFLAG_EH_PENDING in ata_eh_reset()
        ata: pata_parport: Fix code style issues
        ata: libahci: clear pending interrupt status
        ata: sata_mv: Fix incorrect string length computation in mv_dump_mem()
        ata: libata: disallow dev-initiated LPM transitions to unsupported states
      cc3e5afc