Archive-only list for patches
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Baokun Li <libaokun1@huawei.com>,
	Jan Kara <jack@suse.cz>, Theodore Tso <tytso@mit.edu>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.1 08/86] ext4: make ext4_es_insert_extent() return void
Date: Wed,  7 Aug 2024 16:59:47 +0200	[thread overview]
Message-ID: <20240807150039.523957970@linuxfoundation.org> (raw)
In-Reply-To: <20240807150039.247123516@linuxfoundation.org>

6.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Baokun Li <libaokun1@huawei.com>

[ Upstream commit 6c120399cde6b1b5cf65ce403765c579fb3d3e50 ]

Now ext4_es_insert_extent() never return error, so make it return void.

Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230424033846.4732-12-libaokun1@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Stable-dep-of: 0ea6560abb3b ("ext4: check the extent status again before inserting delalloc block")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/ext4/extents.c        |  5 +++--
 fs/ext4/extents_status.c | 14 ++++++--------
 fs/ext4/extents_status.h |  6 +++---
 fs/ext4/inode.c          | 21 ++++++---------------
 4 files changed, 18 insertions(+), 28 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 67af684e44e6e..5cbe5ae5ad4a2 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3113,8 +3113,9 @@ static int ext4_zeroout_es(struct inode *inode, struct ext4_extent *ex)
 	if (ee_len == 0)
 		return 0;
 
-	return ext4_es_insert_extent(inode, ee_block, ee_len, ee_pblock,
-				     EXTENT_STATUS_WRITTEN);
+	ext4_es_insert_extent(inode, ee_block, ee_len, ee_pblock,
+			      EXTENT_STATUS_WRITTEN);
+	return 0;
 }
 
 /* FIXME!! we need to try to merge to left or right after zero-out  */
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 9766d3b21ca2e..592229027af72 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -847,12 +847,10 @@ static int __es_insert_extent(struct inode *inode, struct extent_status *newes,
 /*
  * ext4_es_insert_extent() adds information to an inode's extent
  * status tree.
- *
- * Return 0 on success, error code on failure.
  */
-int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
-			  ext4_lblk_t len, ext4_fsblk_t pblk,
-			  unsigned int status)
+void ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
+			   ext4_lblk_t len, ext4_fsblk_t pblk,
+			   unsigned int status)
 {
 	struct extent_status newes;
 	ext4_lblk_t end = lblk + len - 1;
@@ -864,13 +862,13 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
 	bool revise_pending = false;
 
 	if (EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY)
-		return 0;
+		return;
 
 	es_debug("add [%u/%u) %llu %x to extent status tree of inode %lu\n",
 		 lblk, len, pblk, status, inode->i_ino);
 
 	if (!len)
-		return 0;
+		return;
 
 	BUG_ON(end < lblk);
 
@@ -939,7 +937,7 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
 		goto retry;
 
 	ext4_es_print_tree(inode);
-	return 0;
+	return;
 }
 
 /*
diff --git a/fs/ext4/extents_status.h b/fs/ext4/extents_status.h
index 4ec30a7982605..481ec4381bee6 100644
--- a/fs/ext4/extents_status.h
+++ b/fs/ext4/extents_status.h
@@ -127,9 +127,9 @@ extern int __init ext4_init_es(void);
 extern void ext4_exit_es(void);
 extern void ext4_es_init_tree(struct ext4_es_tree *tree);
 
-extern int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
-				 ext4_lblk_t len, ext4_fsblk_t pblk,
-				 unsigned int status);
+extern void ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
+				  ext4_lblk_t len, ext4_fsblk_t pblk,
+				  unsigned int status);
 extern void ext4_es_cache_extent(struct inode *inode, ext4_lblk_t lblk,
 				 ext4_lblk_t len, ext4_fsblk_t pblk,
 				 unsigned int status);
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 2479508deab3b..6dc15ad45ac95 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -595,10 +595,8 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
 		    ext4_es_scan_range(inode, &ext4_es_is_delayed, map->m_lblk,
 				       map->m_lblk + map->m_len - 1))
 			status |= EXTENT_STATUS_DELAYED;
-		ret = ext4_es_insert_extent(inode, map->m_lblk,
-					    map->m_len, map->m_pblk, status);
-		if (ret < 0)
-			retval = ret;
+		ext4_es_insert_extent(inode, map->m_lblk, map->m_len,
+				      map->m_pblk, status);
 	}
 	up_read((&EXT4_I(inode)->i_data_sem));
 
@@ -707,12 +705,8 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
 		    ext4_es_scan_range(inode, &ext4_es_is_delayed, map->m_lblk,
 				       map->m_lblk + map->m_len - 1))
 			status |= EXTENT_STATUS_DELAYED;
-		ret = ext4_es_insert_extent(inode, map->m_lblk, map->m_len,
-					    map->m_pblk, status);
-		if (ret < 0) {
-			retval = ret;
-			goto out_sem;
-		}
+		ext4_es_insert_extent(inode, map->m_lblk, map->m_len,
+				      map->m_pblk, status);
 	}
 
 out_sem:
@@ -1812,7 +1806,6 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock,
 		set_buffer_new(bh);
 		set_buffer_delay(bh);
 	} else if (retval > 0) {
-		int ret;
 		unsigned int status;
 
 		if (unlikely(retval != map->m_len)) {
@@ -1825,10 +1818,8 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock,
 
 		status = map->m_flags & EXT4_MAP_UNWRITTEN ?
 				EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN;
-		ret = ext4_es_insert_extent(inode, map->m_lblk, map->m_len,
-					    map->m_pblk, status);
-		if (ret != 0)
-			retval = ret;
+		ext4_es_insert_extent(inode, map->m_lblk, map->m_len,
+				      map->m_pblk, status);
 	}
 
 out_unlock:
-- 
2.43.0




  parent reply	other threads:[~2024-08-07 15:13 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07 14:59 [PATCH 6.1 00/86] 6.1.104-rc1 review Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 01/86] arm64: dts: qcom: msm8998: switch USB QMP PHY to new style of bindings Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 02/86] arm64: dts: qcom: msm8998: Disable SS instance in Parkmode for USB Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 03/86] arm64: dts: qcom: ipq8074: " Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 04/86] sysctl: allow change system v ipc sysctls inside ipc namespace Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 05/86] sysctl: allow to change limits for posix messages queues Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 06/86] sysctl: treewide: drop unused argument ctl_table_root::set_ownership(table) Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 07/86] sysctl: always initialize i_uid/i_gid Greg Kroah-Hartman
2024-08-07 14:59 ` Greg Kroah-Hartman [this message]
2024-08-07 14:59 ` [PATCH 6.1 09/86] ext4: refactor ext4_da_map_blocks() Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 10/86] ext4: convert to exclusive lock while inserting delalloc extents Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 11/86] ext4: factor out a common helper to query extent map Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 12/86] ext4: check the extent status again before inserting delalloc block Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 13/86] cpufreq: qcom-nvmem: Convert to platform remove callback returning void Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 14/86] cpufreq: qcom-nvmem: Simplify driver data allocation Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 15/86] cpufreq: qcom-nvmem: fix memory leaks in probe error paths Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 16/86] leds: trigger: Remove unused function led_trigger_rename_static() Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 17/86] leds: trigger: Store brightness set by led_trigger_event() Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 18/86] leds: trigger: Call synchronize_rcu() before calling trig->activate() Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 19/86] leds: triggers: Flush pending brightness before activating trigger Greg Kroah-Hartman
2024-08-07 14:59 ` [PATCH 6.1 20/86] mm: restrict the pcp batch scale factor to avoid too long latency Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 21/86] mm: page_alloc: control latency caused by zone PCP draining Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 22/86] mm/page_alloc: fix pcp->count race between drain_pages_zone() vs __rmqueue_pcplist() Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 23/86] f2fs: fix to avoid use SSR allocate when do defragment Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 24/86] f2fs: assign CURSEG_ALL_DATA_ATGC if blkaddr is valid Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 25/86] irqdomain: Use return value of strreplace() Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 26/86] irqdomain: Fixed unbalanced fwnode get and put Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 27/86] drm/udl: Rename struct udl_drm_connector to struct udl_connector Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 28/86] drm/udl: Test pixel limit in mode-configs mode-valid function Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 29/86] drm/udl: Use USB timeout constant when reading EDID Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 30/86] drm/udl: Various improvements to the connector Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 31/86] drm/udl: Move connector to modesetting code Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 32/86] drm/udl: Remove DRM_CONNECTOR_POLL_HPD Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 33/86] drm/i915/dp: Dont switch the LTTPR mode on an active link Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 34/86] MIPS: Loongson64: DTS: Add RTC support to Loongson-2K1000 Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 35/86] MIPS: Loongson64: DTS: Fix PCIe port nodes for ls7a Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 36/86] MIPS: dts: loongson: Fix liointc IRQ polarity Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 37/86] MIPS: dts: loongson: Fix ls2k1000-rtc interrupt Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 38/86] HID: amd_sfh: Remove duplicate cleanup Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 39/86] HID: amd_sfh: Split sensor and HID initialization Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 40/86] HID: amd_sfh: Move sensor discovery before HID device initialization Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 41/86] drm/nouveau: prime: fix refcount underflow Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 42/86] drm/vmwgfx: Fix overlay when using Screen Targets Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 43/86] drm/vmwgfx: Trigger a modeset when the screen moves Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 44/86] sched: act_ct: take care of padding in struct zones_ht_key Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 45/86] ALSA: hda: conexant: Reduce CONFIG_PM dependencies Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 46/86] ALSA: hda: conexant: Fix headset auto detect fail in the polling mode Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 47/86] Bluetooth: hci_sync: Fix suspending with wrong filter policy Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 48/86] net: axienet: start napi before enabling Rx/Tx Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 49/86] rtnetlink: Dont ignore IFLA_TARGET_NETNSID when ifname is specified in rtnl_dellink() Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 50/86] ice: respect netif readiness in AF_XDP ZC related ndos Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 51/86] ice: dont busy wait for Rx queue disable in ice_qp_dis() Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 52/86] ice: replace synchronize_rcu with synchronize_net Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 53/86] ice: add missing WRITE_ONCE when clearing ice_rx_ring::xdp_prog Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 54/86] net/iucv: fix use after free in iucv_sock_close() Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 55/86] drm/i915/hdcp: Fix HDCP2_STREAM_STATUS macro Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 56/86] net: mvpp2: Dont re-use loop iterator Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 57/86] ALSA: hda: Conditionally use snooping for AMD HDMI Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 58/86] netfilter: iptables: Fix null-ptr-deref in iptable_nat_table_init() Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 59/86] netfilter: iptables: Fix potential null-ptr-deref in ip6table_nat_table_init() Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 60/86] net/mlx5: Lag, dont use the hardcoded value of the first port Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 61/86] net/mlx5: Fix missing lock on sync reset reload Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 62/86] net/mlx5e: Add a check for the return value from mlx5_port_set_eth_ptys Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 63/86] ipv6: fix ndisc_is_useropt() handling for PIO Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 64/86] riscv/mm: Add handling for VM_FAULT_SIGSEGV in mm_fault_error() Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 65/86] arm64: jump_label: Ensure patched jump_labels are visible to all CPUs Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 66/86] rust: SHADOW_CALL_STACK is incompatible with Rust Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 67/86] platform/chrome: cros_ec_proto: Lock device when updating MKBP version Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 68/86] HID: wacom: Modify pen IDs Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 69/86] btrfs: zoned: fix zone_unusable accounting on making block group read-write again Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 70/86] protect the fetch of ->fd[fd] in do_dup2() from mispredictions Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 71/86] mptcp: sched: check both directions for backup Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 72/86] ALSA: usb-audio: Correct surround channels in UAC1 channel map Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 73/86] ALSA: hda/realtek: Add quirk for Acer Aspire E5-574G Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 74/86] Revert "ALSA: firewire-lib: obsolete workqueue for period update" Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 75/86] Revert "ALSA: firewire-lib: operate for period elapse event in process context" Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 76/86] drm/vmwgfx: Fix a deadlock in dma buf fence polling Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 77/86] drm/i915: Fix possible int overflow in skl_ddi_calculate_wrpll() Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 78/86] net: usb: sr9700: fix uninitialized variable use in sr_mdio_read Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 79/86] r8169: dont increment tx_dropped in case of NETDEV_TX_BUSY Greg Kroah-Hartman
2024-08-07 15:00 ` [PATCH 6.1 80/86] mptcp: fix user-space PM announced address accounting Greg Kroah-Hartman
2024-08-07 15:01 ` [PATCH 6.1 81/86] mptcp: distinguish rcv vs sent backup flag in requests Greg Kroah-Hartman
2024-08-07 15:01 ` [PATCH 6.1 82/86] mptcp: fix NL PM announced address accounting Greg Kroah-Hartman
2024-08-07 15:01 ` [PATCH 6.1 83/86] mptcp: fix bad RCVPRUNED mib accounting Greg Kroah-Hartman
2024-08-07 15:01 ` [PATCH 6.1 84/86] mptcp: pm: only set request_bkup flag when sending MP_PRIO Greg Kroah-Hartman
2024-08-07 15:01 ` [PATCH 6.1 85/86] mptcp: fix duplicate data handling Greg Kroah-Hartman
2024-08-07 15:01 ` [PATCH 6.1 86/86] selftests: mptcp: always close inputs FD if opened Greg Kroah-Hartman
2024-08-07 17:32 ` [PATCH 6.1 00/86] 6.1.104-rc1 review Pavel Machek
2024-08-07 17:42 ` Mark Brown
2024-08-07 18:22 ` Anders Roxell
2024-08-07 20:35 ` Salvatore Bonaccorso
2024-08-11 10:09   ` Greg Kroah-Hartman
2024-08-11 15:03     ` Salvatore Bonaccorso
2024-08-11 15:40       ` Greg Kroah-Hartman
2024-08-12 17:49         ` Salvatore Bonaccorso
2024-08-13  6:08           ` Greg Kroah-Hartman
2024-08-07 21:10 ` Florian Fainelli
2024-08-07 21:39 ` Shuah Khan

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=20240807150039.523957970@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=jack@suse.cz \
    --cc=libaokun1@huawei.com \
    --cc=patches@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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