{"id":2219515,"url":"http://patchwork.ozlabs.org/api/patches/2219515/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20260403082507.1882703-2-yebin@huaweicloud.com/","project":{"id":8,"url":"http://patchwork.ozlabs.org/api/projects/8/?format=json","name":"Linux ext4 filesystem development","link_name":"linux-ext4","list_id":"linux-ext4.vger.kernel.org","list_email":"linux-ext4@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260403082507.1882703-2-yebin@huaweicloud.com>","list_archive_url":null,"date":"2026-04-03T08:25:05","name":"[1/3] ext4: register 'orphan_list' procfs","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"492a474eeb64d6ae4d664ff2e4c2946b34a92a70","submitter":{"id":85089,"url":"http://patchwork.ozlabs.org/api/people/85089/?format=json","name":"Ye Bin","email":"yebin@huaweicloud.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-ext4/patch/20260403082507.1882703-2-yebin@huaweicloud.com/mbox/","series":[{"id":498600,"url":"http://patchwork.ozlabs.org/api/series/498600/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-ext4/list/?series=498600","date":"2026-04-03T08:25:07","name":"show orphan file inode detail info","version":1,"mbox":"http://patchwork.ozlabs.org/series/498600/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2219515/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2219515/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <SRS0=9sNr=CC=vger.kernel.org=linux-ext4+bounces-15622-patchwork-incoming=ozlabs.org@ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-ext4@vger.kernel.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","patchwork-incoming@ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=9snr=cc=vger.kernel.org=linux-ext4+bounces-15622-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)","gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c04:e001:36c::12fc:5321\"\n arc.chain=subspace.kernel.org","gandalf.ozlabs.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com","gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15622-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=45.249.212.51","smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=huaweicloud.com"],"Received":["from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnBg46S3Sz1yDH\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 19:27:42 +1100 (AEDT)","from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fnBg21PV0z4wBD\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 19:27:42 +1100 (AEDT)","by gandalf.ozlabs.org (Postfix)\n\tid 4fnBg21KQYz4wTH; Fri, 03 Apr 2026 19:27:42 +1100 (AEDT)","from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4fnBfx4Lj2z4wBD\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 03 Apr 2026 19:27:37 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 82D88302084E\n\tfor <patchwork-incoming@ozlabs.org>; Fri,  3 Apr 2026 08:27:33 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 1B5B53659F9;\n\tFri,  3 Apr 2026 08:27:33 +0000 (UTC)","from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com\n [45.249.212.51])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id ADA5B2F12CF\n\tfor <linux-ext4@vger.kernel.org>; Fri,  3 Apr 2026 08:27:29 +0000 (UTC)","from mail.maildlp.com (unknown [172.19.163.170])\n\tby dggsgout11.his.huawei.com (SkyGuard) with ESMTPS id 4fnBf86vFVzYQtqT\n\tfor <linux-ext4@vger.kernel.org>; Fri,  3 Apr 2026 16:26:56 +0800 (CST)","from mail02.huawei.com (unknown [10.116.40.128])\n\tby mail.maildlp.com (Postfix) with ESMTP id 4DD824056D\n\tfor <linux-ext4@vger.kernel.org>; Fri,  3 Apr 2026 16:27:22 +0800 (CST)","from huaweicloud.com (unknown [10.50.87.132])\n\tby APP4 (Coremail) with SMTP id gCh0CgDHn0roec9pD5T6DA--.40142S5;\n\tFri, 03 Apr 2026 16:27:22 +0800 (CST)"],"ARC-Seal":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1775204862; cv=pass;\n\tb=nWUMfUdGS3g6wT7CwZtdLUEFpmK8BM3qo2xgGqRUVRkrLdEIidFuiAxcjmTjton2BoOX97VoLnqVEUJgixMs8/zfNatonfiVb2B+SAFKiWBBpJOmKtp0cDhLmfEF3VsIISu8MwQvVKCj7McNCRWplh4onfc6typl3GdsoJoM1lssf3//9GWHBZ6cScPTE1DzrcebtCI3CSMK1/iubGFYktywzYSLEZGJ6BbiNRAltyao/vrUMNqDP1IPspgdl5EHP10RLow/Qs1hxBEL7CpCi5W7s7C+mG6uxP3OHtK4T+ofhDJQDvU2RmwM0udH9Q8y7vmFAQziVJ8k0akg/ljPlQ==","i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775204852; cv=none;\n b=oZ7DIrAxNkeex5LUX7luJBHbsh8upGk2uRat5TeLTE/4KEWTG2ECwfHf/MubBgRyqqDho3+B19Mf2At3yK1m56NXkfOSAI5SPxeku8f0youAZ1ZizfoxwmCdluPxkgBWqE9gSR+1JnYXy8LPae1GWB8YnrqVDS5+8Jo7InxUNaM="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1775204862; c=relaxed/relaxed;\n\tbh=L2BaM9ZAJ2+dkCjivHqGl87X3rkdspoDIqO6laBWuD4=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t MIME-Version;\n b=ruLcP8K/wdWTvM/u7Jsn7W96NTl65laNU3zmgOu9NZoa9cMtX+M/a3YveiWrJF6oiRaxO8J/X+CZcqrOr5J2axzmhyoGMxeTlRKZK2p9LRd4CZT+Ljv8h/5TFEhk4KKkp3i/ByotlDntX+wT6x14ReQI8IlzdqvGCCmRuq9OGsofjltkfZqerr9EAYAybx2xIU1m7BltQ+KlFQ21Mx4yImbs8WiF1t/riM4XVrGRFe8EuiGoHsL37f6ibftcp3Rbv4aNKgsedckbcKp/v/6QIDt2fWz9AM7Q9m9G65f+FzPHejJeq4a8AFvIBRxcwPLJ+SzD4mM/MNmgXqVZGD88ug==","i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775204852; c=relaxed/simple;\n\tbh=cs3PrjdXCZ7lXzH3HW/egMfXNvncUhNvd9xXy4zum3g=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t MIME-Version;\n b=DP0uLyZIJ69CcOpzoWb/zOP6owSZcxo/Mdq+bKdyqf3gEbGrSTDOKi6zws2LVeO3QKl4BVRuRQQOKmpMDs3ESXvQ4qCjPJ6Oks0llqo6dlz+/VOVCc5wPnm/8Xer4Xcl1aBkolYK99AYFZ4PFakUAZdgkC4Jp1Z4H8lqthBAx9E="],"ARC-Authentication-Results":["i=2; gandalf.ozlabs.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com;\n spf=pass (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15622-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org","i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com;\n spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51"],"From":"Ye Bin <yebin@huaweicloud.com>","To":"tytso@mit.edu,\n\tadilger.kernel@dilger.ca,\n\tlinux-ext4@vger.kernel.org","Cc":"jack@suse.cz","Subject":"[PATCH 1/3] ext4: register 'orphan_list' procfs","Date":"Fri,  3 Apr 2026 16:25:05 +0800","Message-Id":"<20260403082507.1882703-2-yebin@huaweicloud.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20260403082507.1882703-1-yebin@huaweicloud.com>","References":"<20260403082507.1882703-1-yebin@huaweicloud.com>","Precedence":"bulk","X-Mailing-List":"linux-ext4@vger.kernel.org","List-Id":"<linux-ext4.vger.kernel.org>","List-Subscribe":"<mailto:linux-ext4+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-ext4+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-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8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvj\n\tDU0xZFpf9x07UAEfrUUUUU=","X-CM-SenderInfo":"p1hex046kxt4xhlfz01xgou0bp/","X-Spam-Status":"No, score=-1.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDMARC_MISSING,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,\n\tSPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"},"content":"From: Ye Bin <yebin10@huawei.com>\n\nThis patch register '/proc/fs/ext4/XXX/orphan_list' procfs for show inode\norphan list about EXT4 file system.\nIn actual production environments, there may be inconsistencies in df/du,\nsometimes due to kernel occupation, making it difficult to find such files,\nand it is also difficult to operate in the current network environment. So\nadd \"orphan_list\" procfs to quickly query files that have been deleted but\nare occupied.\n\nSigned-off-by: Ye Bin <yebin10@huawei.com>\n---\n fs/ext4/ext4.h   |  1 +\n fs/ext4/orphan.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++\n fs/ext4/sysfs.c  |  2 ++\n 3 files changed, 73 insertions(+)","diff":"diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h\nindex 876597f8331d..fa38a8380fed 100644\n--- a/fs/ext4/ext4.h\n+++ b/fs/ext4/ext4.h\n@@ -3873,6 +3873,7 @@ extern void ext4_stop_mmpd(struct ext4_sb_info *sbi);\n extern const struct fsverity_operations ext4_verityops;\n \n /* orphan.c */\n+extern const struct proc_ops ext4_orphan_proc_ops;\n extern int ext4_orphan_add(handle_t *, struct inode *);\n extern int ext4_orphan_del(handle_t *, struct inode *);\n extern void ext4_orphan_cleanup(struct super_block *sb,\ndiff --git a/fs/ext4/orphan.c b/fs/ext4/orphan.c\nindex 64ea47624233..1d231aeaf282 100644\n--- a/fs/ext4/orphan.c\n+++ b/fs/ext4/orphan.c\n@@ -4,6 +4,8 @@\n #include <linux/fs.h>\n #include <linux/quotaops.h>\n #include <linux/buffer_head.h>\n+#include <linux/proc_fs.h>\n+#include <linux/seq_file.h>\n \n #include \"ext4.h\"\n #include \"ext4_jbd2.h\"\n@@ -657,3 +659,71 @@ int ext4_orphan_file_empty(struct super_block *sb)\n \t\t\treturn 0;\n \treturn 1;\n }\n+\n+struct ext4_proc_orphan {\n+\tstruct ext4_inode_info cursor;\n+};\n+\n+static void *ext4_orphan_seq_start(struct seq_file *seq, loff_t *pos)\n+{\n+\treturn NULL;\n+}\n+\n+static void *ext4_orphan_seq_next(struct seq_file *seq, void *v, loff_t *pos)\n+{\n+\treturn NULL;\n+}\n+\n+static int ext4_orphan_seq_show(struct seq_file *seq, void *v)\n+{\n+\treturn 0;\n+}\n+\n+static void ext4_orphan_seq_stop(struct seq_file *seq, void *v)\n+{\n+}\n+\n+const struct seq_operations ext4_orphan_seq_ops = {\n+\t.start  = ext4_orphan_seq_start,\n+\t.next   = ext4_orphan_seq_next,\n+\t.stop   = ext4_orphan_seq_stop,\n+\t.show   = ext4_orphan_seq_show,\n+};\n+\n+static int ext4_seq_orphan_open(struct inode *inode, struct file *file)\n+{\n+\tint rc;\n+\tstruct seq_file *m;\n+\tstruct ext4_proc_orphan *private;\n+\n+\trc = seq_open_private(file, &ext4_orphan_seq_ops,\n+\t\t\t      sizeof(struct ext4_proc_orphan));\n+\tif (!rc) {\n+\t\tm = file->private_data;\n+\t\tprivate = m->private;\n+\t\tINIT_LIST_HEAD(&private->cursor.i_orphan);\n+\t\tprivate->cursor.vfs_inode.i_ino = 0;\n+\t}\n+\n+\treturn rc;\n+}\n+\n+static int ext4_seq_orphan_release(struct inode *inode, struct file *file)\n+{\n+\tstruct seq_file *seq = file->private_data;\n+\tstruct ext4_proc_orphan *s = seq->private;\n+\tstruct ext4_sb_info *sbi = EXT4_SB(pde_data(inode));\n+\n+\tmutex_lock(&sbi->s_orphan_lock);\n+\tlist_del(&s->cursor.i_orphan);\n+\tmutex_unlock(&sbi->s_orphan_lock);\n+\n+\treturn seq_release_private(inode, file);\n+}\n+\n+const struct proc_ops ext4_orphan_proc_ops = {\n+\t.proc_open      = ext4_seq_orphan_open,\n+\t.proc_read      = seq_read,\n+\t.proc_lseek     = seq_lseek,\n+\t.proc_release   = ext4_seq_orphan_release,\n+};\ndiff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c\nindex b87d7bdab06a..324eb6b5900e 100644\n--- a/fs/ext4/sysfs.c\n+++ b/fs/ext4/sysfs.c\n@@ -634,6 +634,8 @@ int ext4_register_sysfs(struct super_block *sb)\n \t\t\t\text4_seq_mb_stats_show, sb);\n \t\tproc_create_seq_data(\"mb_structs_summary\", 0444, sbi->s_proc,\n \t\t\t\t&ext4_mb_seq_structs_summary_ops, sb);\n+\t\tproc_create_data(\"orphan_list\", 0444, sbi->s_proc,\n+\t\t\t\t &ext4_orphan_proc_ops, sb);\n \t}\n \treturn 0;\n }\n","prefixes":["1/3"]}