Linux/linux e22254efs/xfs xfs_bmap_util.c xfs_trace.h, fs/xfs/scrub cow_repair.c trace.h

Merge tag 'xfs-fixes-7.2-rc4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Carlos Maiolino:
 "This contains mostly a series of bug fixes found by different LLM
  models"

* tag 'xfs-fixes-7.2-rc4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (21 commits)
  xfs: don't zap bmbt forks if they are MAXLEVELS tall
  xfs: clamp timestamp nanoseconds correctly
  xfs: fully check the parent handle when it points to the rootdir
  xfs: handle non-inode owners for rtrmap record checking
  xfs: fix off-by-one error when calling xchk_xref_has_rt_owner
  xfs: set xfarray killable sort correctly
  xfs: grab rtrmap btree when checking rgsuper
  xfs: write the rg superblock when fixing it
  xfs: use the rt version of the cow staging checker
  xfs: use rtrefcount btree cursor in xchk_xref_is_rt_cow_staging
  xfs: don't wrap around quota ids in dqiterate
  xfs: move cow_replace_mapping to xfs_bmap_util.c

    [9 lines not shown]
DeltaFile
+86-93fs/xfs/scrub/cow_repair.c
+89-0fs/xfs/xfs_bmap_util.c
+41-0fs/xfs/xfs_trace.h
+36-0fs/xfs/xfs_reflink.c
+0-35fs/xfs/scrub/trace.h
+17-11fs/xfs/xfs_sysfs.c
+269-13915 files not shown
+340-16921 files

Linux/linux 133fc7afs/erofs super.c ishare.c

Merge tag 'erofs-for-7.2-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs

Pull erofs fixes from Gao Xiang:

 - Fix sanity checks for ztailpacking tail pclusters to avoid
   false corruption reports

 - Use more informative s_id for file-backed mounts

 - Hide the meaningless "cache_strategy=" mount option on plain
   (uncompressed) filesystems

 - Remove the unneeded erofs_is_ishare_inode() helper

* tag 'erofs-for-7.2-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
  erofs: hide "cache_strategy=" for plain filesystems
  erofs: get rid of erofs_is_ishare_inode() helper
  erofs: relax sanity check for tail pclusters due to ztailpacking
  erofs: use more informative s_id for file-backed mounts
DeltaFile
+5-14fs/erofs/super.c
+1-7fs/erofs/ishare.c
+2-1fs/erofs/zmap.c
+8-223 files

Linux/linux 6f5156ddrivers/cpufreq intel_pstate.c cpufreq.c

Merge tag 'pm-7.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These fix two cpufreq issues, one in the intel_pstate driver and one
  in the core:

   - Make cpufreq_update_pressure() use cpuinfo.max_freq as the default
     reference frequency when arch_scale_freq_ref() returns 0 to allow
     the scheduler to still take CPU frequency caps into account in
     those cases (Rafael Wysocki)

   - Use the HWP guaranteed performance level as the full capacity
     performance in intel_pstate on hybrid systems when turbo
     frequencies are not allowed to be used to make scale-invariance
     work as expected in those cases (Rafael Wysocki)"

* tag 'pm-7.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: Make cpufreq_update_pressure() fall back to cpuinfo.max_freq
  cpufreq: intel_pstate: Set non-turbo capacity to HWP_GUARANTEED_PERF()
DeltaFile
+4-2drivers/cpufreq/intel_pstate.c
+3-0drivers/cpufreq/cpufreq.c
+7-22 files

Linux/linux 4302c35drivers/pmdomain/imx imx93-blk-ctrl.c imx8m-blk-ctrl.c, drivers/pmdomain/mediatek mtk-pm-domains.c

Merge tag 'pmdomain-v7.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm

Pull pmdomain fixes from Ulf Hansson:
 "imx:
   - Assign child domains for imx93 to prevent power off when in use
   - Fix i.MX8MP power up sequences

  mediatek:
   - Fix possible nullptr in HWV cleanup/on-check"

* tag 'pmdomain-v7.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
  pmdomain: mediatek: Fix possible nullptr KP in HWV cleanup/on-check
  pmdomain: imx: Fix i.MX8MP VC8000E power up sequence
  pmdomain: imx: Fix i.MX8MP power notifier
  pmdomain: imx93-blk-ctrl: Extract PHY as shared domain for DSI/CSI
  dt-bindings: power: imx93: Add MIPI PHY power domain
DeltaFile
+58-2drivers/pmdomain/imx/imx93-blk-ctrl.c
+44-2drivers/pmdomain/imx/imx8m-blk-ctrl.c
+33-7drivers/pmdomain/mediatek/mtk-pm-domains.c
+1-0include/dt-bindings/power/fsl,imx93-power.h
+136-114 files

Linux/linux c270a42arch/arm64/kvm nested.c emulate-nested.c, arch/arm64/kvm/hyp/nvhe ffa.c

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "arm64:

   - Fix an accounting buglet when reclaiming pages from a protected
     guest

   - Fix a bunch of architectural compliance issues when injecting a
     synthesised exception, most of which were missing the PSTATE.IL bit
     indicating a 32bit-wide instruction

   - Another set of fixes addressing issues with translation of
     VNCR_EL2, including corner cases where the guest point that
     register at a RO page...

   - Don't warn when trapping accesses to ZCR_EL2 from an L2 guest, as
     that's not unexpected at all


    [76 lines not shown]
DeltaFile
+255-0tools/testing/selftests/kvm/arm64/mmio_sign_ext.c
+83-81arch/arm64/kvm/nested.c
+39-50arch/x86/kvm/vmx/nested.c
+47-0tools/testing/selftests/kvm/x86/sev_migrate_tests.c
+30-14arch/arm64/kvm/hyp/nvhe/ffa.c
+29-12arch/arm64/kvm/emulate-nested.c
+483-15727 files not shown
+621-23533 files

Linux/linux 25f744farch/x86/kvm/svm svm.c

KVM: SVM: Bump asid_generation on CPU online to avoid ASID collision after hotplug

If a vCPU stays scheduled out (or blocked) while the last pCPU it ran
on goes through a hotplug cycle (online->offline->online), and the vCPU
then resumes execution on the same pCPU, then it is possible for it to
run with an ASID that has now been assigned to a different vCPU,
resulting in stale TLB translations being used.

svm_enable_virtualization_cpu() resets asid_generation to 1 and sets
next_asid to max_asid + 1 on every CPU online event, including hotplug
cycles.  Because next_asid starts beyond the pool boundary, the first
call to new_asid() after an online event always wraps the pool,
incrementing asid_generation to 2 and assigning ASIDs starting from
min_asid.

Consider two vCPUs from different VMs, vCPU-A pinned to CPU-X holding
asid_generation=2 and ASID=N from before the hotplug event:

  1. CPU-X goes offline and back online: asid_generation resets to 1,

    [39 lines not shown]
DeltaFile
+6-1arch/x86/kvm/svm/svm.c
+6-11 files

Linux/linux 37e2f87lib bug.c

Merge tag 'linux_kselftest-kunit-fixes-7.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kunit fix from Shuah Khan:
 "Fix warning suppressions with kunit built as module:

  CONFIG_KUNIT is a tristate symbol but the warning suppression code in
  lib/bug.c is only built if it's built-in due to it using a plain
  #ifdef, rendering warning suppressions broken for kunit build as
  loadable module.

  kunit_is_suppressed_warning() already has a stub for when kunit is
  disabled so drop that guard entirely"

* tag 'linux_kselftest-kunit-fixes-7.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  bug: fix warning suppressions with kunit built as module
DeltaFile
+0-2lib/bug.c
+0-21 files

Linux/linux e144887tools/testing/selftests/ftrace/test.d/dynevent add_remove_fprobe_module.tc, tools/testing/selftests/ftrace/test.d/trigger trigger-hist-poll.tc

Merge tag 'linux_kselftest-fixes-7.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest fixes from Shuah Khan:

 - Fix ftrace reading enabled_func test in add_remove_fprobe_module test

 - Fix tracing trigger-hist-poll.tc to use sched_process_exit

* tag 'linux_kselftest-fixes-7.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/tracing: Have trigger-hist-poll.tc use sched_process_exit
  selftests/ftrace: Fix reading enabled_functions in add_remove_fprobe_module test
DeltaFile
+18-9tools/testing/selftests/ftrace/test.d/dynevent/add_remove_fprobe_module.tc
+2-2tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-poll.tc
+20-112 files

Linux/linux 2f2312carch/x86/kvm/vmx nested.c

KVM: nVMX: Put vmcs12 pages if nested VM-Enter fails due to invalid guest state

Put all vmcs12 pages if KVM synthesizes a nested VM-Exit due to invalid
guest while emulating VMLAUNCH or VMRESUME.  The invalid guest state path
doesn't use nested_vmx_vmexit() as that API is intended to be used if and
only if L2 is active, and the open coded equivalent neglects to put the
vmcs12 pages.  Failure to put the vmcs12 pages leaks any pinned pages
(and/or mappings) if L1 retries VMLAUNCH/VMRESUME.

Note, the !from_vmenter scenario doesn't suffer the same problem, as
vmx_get_nested_state_pages() only gets/pins/maps the vmcs12 pages if L2 is
active, i.e. if a "full" VM-Exit is guaranteed before KVM will retry
getting vmcs12 pages.

Fixes: 96c66e87deee ("KVM/nVMX: Use kvm_vcpu_map when mapping the virtual APIC page")
Fixes: 3278e0492554 ("KVM/nVMX: Use kvm_vcpu_map when mapping the posted interrupt descriptor table")
Fixes: fe1911aa443e ("KVM: nVMX: Use kvm_vcpu_map() to get/pin vmcs12's APIC-access page")
Reported-by: Minh Nguyen <minhnguyen.080505 at gmail.com>
Cc: stable at vger.kernel.org

    [2 lines not shown]
DeltaFile
+2-0arch/x86/kvm/vmx/nested.c
+2-01 files

Linux/linux 5246d32arch/s390/kvm pci.c gmap.c

Merge tag 'kvm-s390-master-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD

KVM: s390: Fixes for 7.2

- more gmap KVM memory management fixes
- PCI passthru fixes
DeltaFile
+9-3arch/s390/kvm/pci.c
+6-1arch/s390/kvm/gmap.c
+4-2arch/s390/kvm/kvm-s390.c
+2-0arch/s390/kvm/dat.c
+21-64 files

Linux/linux 37694e5arch/x86/kvm lapic.c, arch/x86/kvm/svm sev.c

Merge tag 'kvm-x86-fixes-7.2-rc4' of https://github.com/kvm-x86/linux into HEAD

KVM x86 fixes for 7.2-rcN

 - Fix a bug where KVM will trigger a UAF if updating IOMMU IRTEs fails when
   registering an IRQ-bypass producer.

 - Ignore pending PV EOI instead of BUG()ing the host if the feature was
   disabled by the guest.

 - Fix nVMX bugs where KVM would run L1 with an L1-controlled CR3 after a
   failed "late" consistency check when KVM is NOT using EPT.

 - Disallow intra-host migration/mirroring of SNP VMs as KVM doesn't yet
   support moving/mirroring SNP state.

 - Fix a TOCTOU bug in KVM's handling of the "trusted" CPUID for TDX guests.

 - Fix a NULL pointer deref in trace_kvm_inj_exception() where a change to the
   core infrastructure missed KVM's unique (ab)use of __print_symbolic().
DeltaFile
+37-50arch/x86/kvm/vmx/nested.c
+47-0tools/testing/selftests/kvm/x86/sev_migrate_tests.c
+6-2arch/x86/kvm/lapic.c
+7-0arch/x86/kvm/vmx/vmx.h
+5-1arch/x86/kvm/vmx/tdx.c
+4-2arch/x86/kvm/svm/sev.c
+106-552 files not shown
+110-578 files

Linux/linux 15f8ba7arch/arm64/kvm/hyp pgtable.c, arch/arm64/kvm/hyp/nvhe ffa.c

Merge tag 'kvmarm-fixes-7.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 7.2, take #2

- Move locking for kvm_io_bus_get_dev() into the caller, ensuring
  race-free checks that the returned object is of the correct type

- Fix initialisation of the page-table walk level when relaxing
  permissions

- Correctly update the XN attribute when relaxing permissions

- Fix the sign extension of loads from emulated MMIO regions

- Assorted collection of fixes for pKVM's FFA proxy, together with a
  couple of FFA driver adjustments
DeltaFile
+255-0tools/testing/selftests/kvm/arm64/mmio_sign_ext.c
+30-14arch/arm64/kvm/hyp/nvhe/ffa.c
+17-8drivers/firmware/arm_ffa/driver.c
+5-11virt/kvm/kvm_main.c
+9-6arch/arm64/kvm/hyp/pgtable.c
+8-1include/linux/arm_ffa.h
+324-403 files not shown
+331-439 files

Linux/linux 5b0d046arch/arm64/kvm nested.c emulate-nested.c, arch/arm64/kvm/hyp/include/hyp switch.h

Merge tag 'kvmarm-fixes-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 7.2, take #1

- Fix an accounting buglet when reclaiming pages from a protected
  guest

- Fix a bunch of architectural compliance issues when injecting a
  synthesised exception, most of which were missing the PSTATE.IL bit
  indicating a 32bit-wide instruction

- Another set of fixes addressing issues with translation of VNCR_EL2,
  including corner cases where the guest point that register at a RO
  page...

- Don't warn when trapping accesses to ZCR_EL2 from an L2 guest, as
  that's not unexpected at all

- Address a bunch of races with LPI migration vs LPIs being disabled

    [6 lines not shown]
DeltaFile
+83-81arch/arm64/kvm/nested.c
+29-12arch/arm64/kvm/emulate-nested.c
+14-6arch/arm64/kvm/vgic/vgic.c
+5-13arch/arm64/kvm/inject_fault.c
+6-5arch/arm64/kvm/hyp/include/hyp/switch.h
+0-8arch/arm64/kvm/at.c
+137-1255 files not shown
+151-12811 files

Linux/linux 58717b2sound/hda/codecs/realtek alc269.c, sound/hda/codecs/side-codecs cs35l56_hda.c

Merge tag 'sound-7.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes. All are device-specific fixes (including
  regression fixes) or quirks accumulated since the last update. Some
  highlights:

  USB-audio:
   - Fix per-channel volume imbalance regression for sticky mixers
   - Validate input packet length in caiaq driver
   - Quirks for iBasso DC-Elite, Musical Fidelity M6s DAC, and Redragon
     H510-PRO Wireless headset

  HD-audio:
   - Fix a long-standing bug of cached processing coefficient verbs
   - Make cs35l56 driver failing with missing firmware
   - Fix cirrus codec Kconfig dependency, update MAINTAINERS
   - Remove unneeded mic bias threshold override on Conexant
   - Realtek codec quirks for ASUS ROG Ally X (headphone & mic), Dell

    [40 lines not shown]
DeltaFile
+47-2sound/hda/codecs/realtek/alc269.c
+46-1sound/soc/amd/acp/amd-acp70-acpi-match.c
+31-2sound/soc/amd/ps/pci-ps.c
+9-21sound/hda/codecs/side-codecs/cs35l56_hda.c
+14-3sound/usb/caiaq/device.c
+11-0sound/soc/codecs/rt712-sdca.c
+158-2929 files not shown
+203-5835 files

Linux/linux 7059bdffs/btrfs file-item.c ioctl.c

Merge tag 'for-7.2-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:

 - fix root structure leak after relocation error

 - fix optimization when checksums are read from commit root, fall back
   to checksum root during relocation

 - in tree-checker, validate length of inode reference in items

 - validate properties before setting them

 - validate free space cache entries on load

 - transaction abort fixes

 - fix printing of internal trees as signed numbers


    [12 lines not shown]
DeltaFile
+25-1fs/btrfs/file-item.c
+12-6fs/btrfs/ioctl.c
+13-3fs/btrfs/props.c
+7-8fs/btrfs/relocation.c
+12-3fs/btrfs/lzo.c
+4-4fs/btrfs/print-tree.c
+73-252 files not shown
+82-258 files

Linux/linux a1caeeafs/xfs/scrub cow_repair.c trace.h

xfs: don't replace the wrong part of the cow fork

LOLLM points out that xfs_iext_lookup_extent can return a @got where
got->br_startoff < startoff.  In this case, xrep_cow_replace_range
replaces the entire mapping instead of just the part that had been
marked bad in the bitmap, but advances the bitmap cursor in
xrep_cow_replace by the amount replaced.  As a result, we fail to
replace the end of the bad range, and replace part of the good range.

Fix this by rewriting the replace method to handle replacing the middle
of a cow fork mapping.  This we do by returning both the current mapping
as @got, and the subset of the mapping that we want to replace as @rep,
using @rep to store the results of the new allocation, and comparing
@rep to @got to figure out the exact transformations needed.

Cc: stable at vger.kernel.org # v6.8
Fixes: dbbdbd0086320a ("xfs: repair problems in CoW forks")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs

    [2 lines not shown]
DeltaFile
+131-72fs/xfs/scrub/cow_repair.c
+17-11fs/xfs/scrub/trace.h
+148-832 files

Linux/linux 5d72a68fs/xfs/scrub rtbitmap.c

xfs: fix off-by-one error when calling xchk_xref_has_rt_owner

LOLLM noticed an off-by-one error when computing the length of the
rtrmap to cross-check.

Cc: stable at vger.kernel.org # v6.14
Fixes: 037a44d8277adf ("xfs: cross-reference the realtime rmapbt")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+1-1fs/xfs/scrub/rtbitmap.c
+1-11 files

Linux/linux ee24815fs/xfs/scrub rtrefcount.c

xfs: use rtrefcount btree cursor in xchk_xref_is_rt_cow_staging

LOLLM points out that we pass the wrong btree cursor here.  We want the
rtrefcount btree cursor, not the non-rt one.  This is fairly benign
since it only affects tracing data.

Cc: stable at vger.kernel.org # v6.14
Fixes: 91683bb3f264c0 ("xfs: cross-reference checks with the rt refcount btree")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+1-1fs/xfs/scrub/rtrefcount.c
+1-11 files

Linux/linux ea6e2d9fs/xfs/scrub rgsuper.c

xfs: grab rtrmap btree when checking rgsuper

LOLLM noticed that we aren't grabbing the rtrmap btree when we check the
realtime group superblock.  As a result, none of the cross-referencing
checks have ever run.  Fix this.

Cc: stable at vger.kernel.org # v6.14
Fixes: 428e4884656db9 ("xfs: allow queued realtime intents to drain before scrubbing")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+9-1fs/xfs/scrub/rgsuper.c
+9-11 files

Linux/linux 59c462bfs/xfs/scrub inode_repair.c

xfs: don't zap bmbt forks if they are MAXLEVELS tall

LOLLM noticed a discrepancy between the bmbt level checks in the libxfs
bmbt code vs. the inode repair code.  We do actually allow a bmbt root
that proclaims to have a height of XFS_BM_MAXLEVELS.

Cc: stable at vger.kernel.org # v6.8
Fixes: e744cef2060559 ("xfs: zap broken inode forks")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+1-1fs/xfs/scrub/inode_repair.c
+1-11 files

Linux/linux 353a590fs/xfs/scrub rtrmap.c

xfs: handle non-inode owners for rtrmap record checking

LOLLM noticed that two helper functions in the rtrmapbt scrub code don't
actually handle non-inode owners correctly -- CoW staging extents and
rgsuperblock extents are not shareable, but they are mergeable.  Fix
these two helpers.

Cc: stable at vger.kernel.org # v6.14
Fixes: 2d9a3e98053e8c ("xfs: allow overlapping rtrmapbt records for shared data extents")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+6-0fs/xfs/scrub/rtrmap.c
+6-01 files

Linux/linux 540ddc6fs/xfs/scrub scrub.h xfarray.c

xfs: set xfarray killable sort correctly

LOLLM noticed that we *disable* interruptible sorts when the KILLABLE
flag is set.  This is backwards.  Fix the incorrect logic, and rename
the variable to make the connection more obvious.

Cc: stable at vger.kernel.org # v6.10
Fixes: 271557de7cbfde ("xfs: reduce the rate of cond_resched calls inside scrub")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+3-3fs/xfs/scrub/scrub.h
+1-2fs/xfs/scrub/xfarray.c
+4-52 files

Linux/linux d766e4efs/xfs/scrub dqiterate.c

xfs: don't wrap around quota ids in dqiterate

LOLLM noticed that q_id is an unsigned 32-bit variable.  If it happens
to be set to XFS_DQ_ID_MAX due to a filesystem that actually has a dquot
for ID_MAX, then this addition will truncate to zero and the iteration
starts over.  Fix this by casting to u64.

Cc: stable at vger.kernel.org # v6.8
Fixes: 21d7500929c8a0 ("xfs: improve dquot iteration for scrub")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+1-1fs/xfs/scrub/dqiterate.c
+1-11 files

Linux/linux 60a1ddefs/xfs xfs_bmap_util.c xfs_trace.h, fs/xfs/scrub cow_repair.c trace.h

xfs: move cow_replace_mapping to xfs_bmap_util.c

Move the actual details of (partially) replacing a COW fork mapping to
xfs_bmap_util.c so that all the code doing hairy operations on subsets
of bmbt_irecs are kept together.

Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+2-93fs/xfs/scrub/cow_repair.c
+89-0fs/xfs/xfs_bmap_util.c
+41-0fs/xfs/xfs_trace.h
+0-41fs/xfs/scrub/trace.h
+4-0fs/xfs/xfs_bmap_util.h
+136-1345 files

Linux/linux 15e38a9fs/xfs/scrub inode_repair.c

xfs: clamp timestamp nanoseconds correctly

LOLLM noticed an off-by-one error in the nsec clamping; fix that so that
we never have tv_nsec == 1e9.

Cc: stable at vger.kernel.org # v6.8
Fixes: 2d295fe65776d1 ("xfs: repair inode records")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+1-1fs/xfs/scrub/inode_repair.c
+1-11 files

Linux/linux ba150cefs/xfs/scrub dirtree.c

xfs: fully check the parent handle when it points to the rootdir

LOLLM noticed that the directory tree path checking declares the path to
be ok if the inumber in the parent pointer reaches the root directory.
Unfortunately, it neglects to check that the generation is correct.  Fix
that by moving the generation check up.

Cc: stable at vger.kernel.org # v6.10
Fixes: 928b721a11789a ("xfs: teach online scrub to find directory tree structure problems")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+8-8fs/xfs/scrub/dirtree.c
+8-81 files

Linux/linux 9af789ffs/xfs/scrub rgsuper.c

xfs: write the rg superblock when fixing it

The rtgroup superblock fixer should write the rtgroup superblock.
LOLLM noticed this, oops. :/

Cc: stable at vger.kernel.org # v6.13
Fixes: 1433f8f9cead37 ("xfs: repair realtime group superblock")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+4-0fs/xfs/scrub/rgsuper.c
+4-01 files

Linux/linux 881f2ebfs/xfs/scrub rtrmap.c

xfs: use the rt version of the cow staging checker

LOLLM also noticed that xchk_rtrmapbt_xref ought to be using the rtdev
version of the "is this a cow extent?" helper function, not the datadev
one.

Cc: stable at vger.kernel.org # v6.14
Fixes: 91683bb3f264c0 ("xfs: cross-reference checks with the rt refcount btree")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+1-1fs/xfs/scrub/rtrmap.c
+1-11 files

Linux/linux bcb0621fs/xfs/scrub cow_repair.c

xfs: make cow repair somewhat flaky when debugging knob enabled

Introduce a new behavior for the cow fork repair code: if the debugging
knob is enabled, we'll pick a random subrange of each cow fork mapping
to mark as bad.  This will exercise the xrep_cow_replace_mapping more
thoroughly.

Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>
Reviewed-by: Christoph Hellwig <hch at lst.de>
Signed-off-by: Carlos Maiolino <cem at kernel.org>
DeltaFile
+29-4fs/xfs/scrub/cow_repair.c
+29-41 files

Linux/linux 2f4acd0fs/xfs xfs_reflink.c

xfs: resample the data fork mapping after cycling ILOCK

xfs_reflink_fill_{cow_hole,delalloc} are both presented with an inode,
a data fork mapping, and a cow fork mapping.  Unfortunately, these two
helpers cycle the ILOCK to grab a transaction, which means that the
mappings are stale as soon as we reacquire the ILOCK.  Currently we
refresh the cow fork mapping by re-calling xfs_find_trim_cow_extent, but
we don't refresh the data fork mapping beforehand, which means that the
xfs_bmap_trim_cow in that function queries the refcount btree about the
wrong physical blocks and returns an inaccurate value in *shared.

If *shared is now false, the directio write proceeds with a stale data
fork mapping.  Fix this by querying the data fork mapping if the
sequence counter changes across the ILOCK cycle.

Cc: hch at lst.de
Cc: stable at vger.kernel.org # v4.11
Fixes: 3c68d44a2b49a0 ("xfs: allocate direct I/O COW blocks in iomap_begin")
Signed-off-by: "Darrick J. Wong" <djwong at kernel.org>

    [3 lines not shown]
DeltaFile
+36-0fs/xfs/xfs_reflink.c
+36-01 files