+ fs-explicitly-unregister-per-superblock-bdis.patch added to -mm tree
From: akpm@linux-foundation.org
Date: 2021-10-22 02:57:47
The patch titled
Subject: fs: explicitly unregister per-superblock BDIs
has been added to the -mm tree. Its filename is
fs-explicitly-unregister-per-superblock-bdis.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/fs-explicitly-unregister-per-superblock-bdis.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/fs-explicitly-unregister-per-superblock-bdis.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Christoph Hellwig <hch@lst.de>
Subject: fs: explicitly unregister per-superblock BDIs
Add a new SB_I_ flag to mark superblocks that have an ephemeral bdi
associated with them, and unregister it when the superblock is shut down.
Link: https://lkml.kernel.org/r/20211021124441.668816-4-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@suse.cz>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/super.c | 3 +++
include/linux/fs.h | 1 +
2 files changed, 4 insertions(+)
--- a/fs/super.c~fs-explicitly-unregister-per-superblock-bdis
+++ a/fs/super.c@@ -476,6 +476,8 @@ void generic_shutdown_super(struct super spin_unlock(&sb_lock); up_write(&sb->s_umount); if (sb->s_bdi != &noop_backing_dev_info) { + if (sb->s_iflags & SB_I_PERSB_BDI) + bdi_unregister(sb->s_bdi); bdi_put(sb->s_bdi); sb->s_bdi = &noop_backing_dev_info; }
@@ -1562,6 +1564,7 @@ int super_setup_bdi_name(struct super_bl } WARN_ON(sb->s_bdi != &noop_backing_dev_info); sb->s_bdi = bdi; + sb->s_iflags |= SB_I_PERSB_BDI; return 0; } --- a/include/linux/fs.h~fs-explicitly-unregister-per-superblock-bdis +++ a/include/linux/fs.h
@@ -1443,6 +1443,7 @@ extern int send_sigurg(struct fown_struc #define SB_I_UNTRUSTED_MOUNTER 0x00000040 #define SB_I_SKIP_SYNC 0x00000100 /* Skip superblock at global sync */ +#define SB_I_PERSB_BDI 0x00000200 /* has a per-sb bdi */ /* Possible states of 'frozen' field */ enum {
_ Patches currently in -mm which might be from hch@lst.de are mm-dont-include-linux-daxh-in-linux-mempolicyh.patch mm-export-bdi_unregister.patch mtd-call-bdi_unregister-explicitly.patch fs-explicitly-unregister-per-superblock-bdis.patch mm-dont-automatically-unregister-bdis.patch mm-simplify-bdi-refcounting.patch mm-unexport-folio_memcg_unlock.patch mm-unexport-unlock_page_memcg.patch