public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] fs: push list presence check into inode_io_list_del()
@ 2025-10-29 13:14 Mateusz Guzik
  2025-10-29 13:14 ` [PATCH v2 2/2] fs: cosmetic fixes to lru handling Mateusz Guzik
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mateusz Guzik @ 2025-10-29 13:14 UTC (permalink / raw)
  To: brauner; +Cc: viro, jack, linux-kernel, linux-fsdevel, Mateusz Guzik

For consistency with sb routines.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
---

rebased

 fs/fs-writeback.c | 3 +++
 fs/inode.c        | 4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index f784d8b09b04..5dccbe5fb09d 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1349,6 +1349,9 @@ void inode_io_list_del(struct inode *inode)
 {
 	struct bdi_writeback *wb;
 
+	if (list_empty(&inode->i_io_list))
+		return;
+
 	wb = inode_to_wb_and_lock_list(inode);
 	spin_lock(&inode->i_lock);
 
diff --git a/fs/inode.c b/fs/inode.c
index 1396f79b2551..b5c2efebaa18 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -815,9 +815,7 @@ static void evict(struct inode *inode)
 	BUG_ON(!(inode_state_read_once(inode) & I_FREEING));
 	BUG_ON(!list_empty(&inode->i_lru));
 
-	if (!list_empty(&inode->i_io_list))
-		inode_io_list_del(inode);
-
+	inode_io_list_del(inode);
 	inode_sb_list_del(inode);
 
 	spin_lock(&inode->i_lock);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-10-31 12:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 13:14 [PATCH v2 1/2] fs: push list presence check into inode_io_list_del() Mateusz Guzik
2025-10-29 13:14 ` [PATCH v2 2/2] fs: cosmetic fixes to lru handling Mateusz Guzik
2025-10-30 13:57   ` Jan Kara
2025-10-30 13:54 ` [PATCH v2 1/2] fs: push list presence check into inode_io_list_del() Jan Kara
2025-10-30 14:13   ` Mateusz Guzik
2025-10-31 12:17 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox