stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Andreas Gruenbacher <agruenba@redhat.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10 006/130] gfs2: Fix length of holes reported at end-of-file
Date: Mon,  6 Dec 2021 15:55:23 +0100	[thread overview]
Message-ID: <20211206145559.827839020@linuxfoundation.org> (raw)
In-Reply-To: <20211206145559.607158688@linuxfoundation.org>

From: Andreas Gruenbacher <agruenba@redhat.com>

[ Upstream commit f3506eee81d1f700d9ee2d2f4a88fddb669ec032 ]

Fix the length of holes reported at the end of a file: the length is
relative to the beginning of the extent, not the seek position which is
rounded down to the filesystem block size.

This bug went unnoticed for some time, but is now caught by the
following assertion in iomap_iter_done():

  WARN_ON_ONCE(iter->iomap.offset + iter->iomap.length <= iter->pos)

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/gfs2/bmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index a1f9dde33058f..b34c02985d9d2 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -940,7 +940,7 @@ static int gfs2_iomap_get(struct inode *inode, loff_t pos, loff_t length,
 		else if (height == ip->i_height)
 			ret = gfs2_hole_size(inode, lblock, len, mp, iomap);
 		else
-			iomap->length = size - pos;
+			iomap->length = size - iomap->offset;
 	} else if (flags & IOMAP_WRITE) {
 		u64 alloc_size;
 
-- 
2.33.0




  parent reply	other threads:[~2021-12-06 15:25 UTC|newest]

Thread overview: 141+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 14:55 [PATCH 5.10 000/130] 5.10.84-rc1 review Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 001/130] NFSv42: Fix pagecache invalidation after COPY/CLONE Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 002/130] can: j1939: j1939_tp_cmd_recv(): check the dst address of TP.CM_BAM Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 003/130] ovl: simplify file splice Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 004/130] ovl: fix deadlock in splice write Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 005/130] gfs2: release iopen glock early in evict Greg Kroah-Hartman
2021-12-06 14:55 ` Greg Kroah-Hartman [this message]
2021-12-06 14:55 ` [PATCH 5.10 007/130] powerpc/pseries/ddw: Revert "Extend upper limit for huge DMA window for persistent memory" Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 008/130] drm/sun4i: fix unmet dependency on RESET_CONTROLLER for PHY_SUN6I_MIPI_DPHY Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 009/130] mac80211: do not access the IV when it was stripped Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 010/130] net/smc: Transfer remaining wait queue entries during fallback Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 011/130] atlantic: Fix OOB read and write in hw_atl_utils_fw_rpc_wait Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 012/130] net: return correct error code Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 013/130] platform/x86: thinkpad_acpi: Add support for dual fan control Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 014/130] platform/x86: thinkpad_acpi: Fix WWAN device disabled issue after S3 deep Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 015/130] s390/setup: avoid using memblock_enforce_memory_limit Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 016/130] btrfs: check-integrity: fix a warning on write caching disabled disk Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 017/130] thermal: core: Reset previous low and high trip during thermal zone init Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 018/130] scsi: iscsi: Unblock session then wake up error handler Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 019/130] drm/amd/amdkfd: Fix kernel panic when reset failed and been triggered again Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 020/130] drm/amd/amdgpu: fix potential memleak Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 021/130] ata: ahci: Add Green Sardine vendor ID as board_ahci_mobile Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 022/130] ethernet: hisilicon: hns: hns_dsaf_misc: fix a possible array overflow in hns_dsaf_ge_srst_by_port() Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 023/130] ipv6: check return value of ipv6_skip_exthdr Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 024/130] net: tulip: de4x5: fix the problem that the array lp->phy[8] may be out of bound Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 025/130] net: ethernet: dec: tulip: de4x5: fix possible array overflows in type3_infoblock() Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 026/130] perf inject: Fix ARM SPE handling Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 027/130] perf hist: Fix memory leak of a perf_hpp_fmt Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 028/130] perf report: Fix memory leaks around perf_tip() Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 029/130] net/smc: Avoid warning of possible recursive locking Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 030/130] ACPI: Add stubs for wakeup handler functions Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 031/130] vrf: Reset IPCB/IP6CB when processing outbound pkts in vrf dev xmit Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 032/130] kprobes: Limit max data_size of the kretprobe instances Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 033/130] rt2x00: do not mark device gone on EPROTO errors during start Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 034/130] ipmi: Move remove_work to dedicated workqueue Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 035/130] cpufreq: Fix get_cpu_device() failure in add_cpu_dev_symlink() Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 036/130] s390/pci: move pseudo-MMIO to prevent MIO overlap Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 037/130] fget: check that the fd still exists after getting a ref to it Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 038/130] sata_fsl: fix UAF in sata_fsl_port_stop when rmmod sata_fsl Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 039/130] sata_fsl: fix warning in remove_proc_entry " Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 040/130] ipv6: fix memory leak in fib6_rule_suppress Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 041/130] drm/amd/display: Allow DSC on supported MST branch devices Greg Kroah-Hartman
2021-12-06 14:55 ` [PATCH 5.10 042/130] KVM: Disallow user memslot with size that exceeds "unsigned long" Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 043/130] KVM: nVMX: Flush current VPID (L1 vs. L2) for KVM_REQ_TLB_FLUSH_GUEST Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 044/130] KVM: x86: Use a stable condition around all VT-d PI paths Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 045/130] KVM: arm64: Avoid setting the upper 32 bits of TCR_EL2 and CPTR_EL2 to 1 Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 046/130] KVM: X86: Use vcpu->arch.walk_mmu for kvm_mmu_invlpg() Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 047/130] tracing/histograms: String compares should not care about signed values Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 048/130] drm/amdkfd: separate kfd_iommu_resume from kfd_resume Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 049/130] drm/amdgpu: add amdgpu_amdkfd_resume_iommu Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 050/130] drm/amdgpu: move iommu_resume before ip init/resume Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 051/130] drm/amdgpu: init iommu after amdkfd device init Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 052/130] drm/amdkfd: fix boot failure when iommu is disabled in Picasso Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 053/130] wireguard: selftests: increase default dmesg log size Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 054/130] wireguard: allowedips: add missing __rcu annotation to satisfy sparse Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 055/130] wireguard: selftests: actually test for routing loops Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 056/130] wireguard: selftests: rename DEBUG_PI_LIST to DEBUG_PLIST Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 057/130] wireguard: device: reset peer src endpoint when netns exits Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 058/130] wireguard: receive: use ring buffer for incoming handshakes Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 059/130] wireguard: receive: drop handshakes if queue lock is contended Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 060/130] wireguard: ratelimiter: use kvcalloc() instead of kvzalloc() Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 061/130] i2c: stm32f7: flush TX FIFO upon transfer errors Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 062/130] i2c: stm32f7: recover the bus on access timeout Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 063/130] i2c: stm32f7: stop dma transfer in case of NACK Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 064/130] i2c: cbus-gpio: set atomic transfer callback Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 065/130] natsemi: xtensa: fix section mismatch warnings Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 066/130] tcp: fix page frag corruption on page fault Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 067/130] net: qlogic: qlcnic: Fix a NULL pointer dereference in qlcnic_83xx_add_rings() Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 068/130] net: mpls: Fix notifications when deleting a device Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 069/130] siphash: use _unaligned version by default Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 070/130] arm64: ftrace: add missing BTIs Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 071/130] net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources() Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 072/130] selftests: net: Correct case name Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 073/130] mt76: mt7915: fix NULL pointer dereference in mt7915_get_phy_mode Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 074/130] ASoC: tegra: Fix wrong value type in ADMAIF Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 075/130] ASoC: tegra: Fix wrong value type in I2S Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 076/130] ASoC: tegra: Fix wrong value type in DMIC Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 077/130] ASoC: tegra: Fix wrong value type in DSPK Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 078/130] ASoC: tegra: Fix kcontrol put callback in ADMAIF Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 079/130] ASoC: tegra: Fix kcontrol put callback in I2S Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 080/130] ASoC: tegra: Fix kcontrol put callback in DMIC Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 081/130] ASoC: tegra: Fix kcontrol put callback in DSPK Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 082/130] ASoC: tegra: Fix kcontrol put callback in AHUB Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 083/130] rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle() Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 084/130] rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer() Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 085/130] ALSA: intel-dsp-config: add quirk for CML devices based on ES8336 codec Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 086/130] net: usb: lan78xx: lan78xx_phy_init(): use PHY_POLL instead of "0" if no IRQ is available Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 087/130] net: marvell: mvpp2: Fix the computation of shared CPUs Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 088/130] dpaa2-eth: destroy workqueue at the end of remove function Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 089/130] net: annotate data-races on txq->xmit_lock_owner Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 090/130] ipv4: convert fib_num_tclassid_users to atomic_t Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 091/130] net/smc: fix wrong list_del in smc_lgr_cleanup_early Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 092/130] net/rds: correct socket tunable error in rds_tcp_tune() Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 093/130] net/smc: Keep smc_close_final rc during active close Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 094/130] drm/msm/a6xx: Allocate enough space for GMU registers Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 095/130] drm/msm: Do hw_init() before capturing GPU state Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 096/130] atlantic: Increase delay for fw transactions Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 097/130] atlatnic: enable Nbase-t speeds with base-t Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 098/130] atlantic: Fix to display FW bundle version instead of FW mac version Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 099/130] atlantic: Add missing DIDs and fix 115c Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 100/130] Remove Half duplex mode speed capabilities Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 101/130] atlantic: Fix statistics logic for production hardware Greg Kroah-Hartman
2021-12-06 14:56 ` [PATCH 5.10 102/130] atlantic: Remove warn trace message Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 103/130] KVM: x86/pmu: Fix reserved bits for AMD PerfEvtSeln register Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 104/130] KVM: VMX: Set failure code in prepare_vmcs02() Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 105/130] x86/sev: Fix SEV-ES INS/OUTS instructions for word, dword, and qword Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 106/130] x86/entry: Use the correct fence macro after swapgs in kernel CR3 Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 107/130] x86/xen: Add xenpv_restore_regs_and_return_to_usermode() Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 108/130] sched/uclamp: Fix rq->uclamp_max not set on first enqueue Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 109/130] x86/pv: Switch SWAPGS to ALTERNATIVE Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 110/130] x86/entry: Add a fence for kernel entry SWAPGS in paranoid_entry() Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 111/130] parisc: Fix KBUILD_IMAGE for self-extracting kernel Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 112/130] parisc: Fix "make install" on newer debian releases Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 113/130] vgacon: Propagate console boot parameters before calling `vc_resize Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 114/130] xhci: Fix commad ring abort, write all 64 bits to CRCR register Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 115/130] USB: NO_LPM quirk Lenovo Powered USB-C Travel Hub Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 116/130] usb: typec: tcpm: Wait in SNK_DEBOUNCED until disconnect Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 117/130] x86/tsc: Add a timer to make sure TSC_adjust is always checked Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 118/130] x86/tsc: Disable clocksource watchdog for TSC on qualified platorms Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 119/130] x86/64/mm: Map all kernel memory into trampoline_pgd Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 120/130] tty: serial: msm_serial: Deactivate RX DMA for polling support Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 121/130] serial: pl011: Add ACPI SBSA UART match id Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 122/130] serial: tegra: Change lower tolerance baud rate limit for tegra20 and tegra30 Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 123/130] serial: core: fix transmit-buffer reset and memleak Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 124/130] serial: 8250_pci: Fix ACCES entries in pci_serial_quirks array Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 125/130] serial: 8250_pci: rewrite pericom_do_set_divisor() Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 126/130] serial: 8250: Fix RTS modem control while in rs485 mode Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 127/130] iwlwifi: mvm: retry init flow if failed Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 128/130] parisc: Mark cr16 CPU clocksource unstable on all SMP machines Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 129/130] net/tls: Fix authentication failure in CCM mode Greg Kroah-Hartman
2021-12-06 14:57 ` [PATCH 5.10 130/130] ipmi: msghandler: Make symbol remove_work_wq static Greg Kroah-Hartman
2021-12-06 16:46 ` [PATCH 5.10 000/130] 5.10.84-rc1 review Guenter Roeck
2021-12-07  8:18   ` Greg Kroah-Hartman
2021-12-06 19:20 ` Florian Fainelli
2021-12-06 21:56 ` Shuah Khan
2021-12-07  2:17 ` Samuel Zou
2021-12-07  8:18   ` Greg Kroah-Hartman
2021-12-07  2:37 ` Naresh Kamboju
2021-12-07  8:19   ` Greg Kroah-Hartman
2021-12-07  6:26 ` Fox Chen
2021-12-07  9:36 ` Jon Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211206145559.827839020@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=agruenba@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).