[RFC PATCH 1/3] fs/drop_caches: do not scan procfs in drop_pagecache_sb()
From: Huang Shijie
Date: Mon Sep 14 2026 - 02:16:42 EST
There is no page cache for the procfs, so do not scan the
inodes in procfs.
Signed-off-by: Huang Shijie <huangsj@xxxxxxxx>
---
fs/drop_caches.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/drop_caches.c b/fs/drop_caches.c
index 49f56a598ecb..1959090089af 100644
--- a/fs/drop_caches.c
+++ b/fs/drop_caches.c
@@ -5,6 +5,7 @@
#include <linux/pagemap.h>
#include <linux/kernel.h>
+#include <linux/magic.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/writeback.h>
@@ -20,6 +21,9 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused)
{
struct inode *inode, *toput_inode = NULL;
+ if (sb->s_magic == PROC_SUPER_MAGIC)
+ return;
+
spin_lock(&sb->s_inode_list_lock);
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
spin_lock(&inode->i_lock);
--
2.53.0