NFS: switch back to using kill_anon_super
Subsystems (3)
PATCH 1/1 NFS: switch back to using kill_anon_super
NFS switch to open coding kill_anon_super in 7b14a213890a ("nfs: don't call bdi_unregister") to avoid the extra bdi_unregister call. At that point bdi_destroy was called in nfs_free_server and thus it required a later freeing of the anon dev_t. But since 0db10944a76b ("nfs: Convert to separately allocated bdi") the bdi has been free implicitly by the sb destruction, so this isn't needed anymore.
By not open coding kill_anon_super, nfs now inherits the fix in dc3216b14160 ("super: ensure valid info"), and we remove the only open coded version of kill_anon_super.
--- fs/nfs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/nfs/super.c +1 -3
@@ -1339,15 +1339,13 @@ int nfs_get_tree_common(struct fs_context *fc)void nfs_kill_super (struct super_block *s) {struct nfs_server *server =NFS_SB (s); -dev_t dev = s->s_dev;nfs_sysfs_move_sb_to_server (server); -generic_shutdown_super (s); +kill_anon_super (s);nfs_fscache_release_super_cookie (s);nfs_free_server (server); -free_anon_bdev (dev); }EXPORT_SYMBOL_GPL (nfs_kill_super);
Signature · 1 line
2.39.2
Quoted 9 lines · Christoph Hellwig
NFS switch to open coding
kill_anon_superin7b14a213890a("nfs: don't callbdi_unregister") to avoid the extrabdi_unregistercall. At that pointbdi_destroywas called innfs_free_serverand thus it required a later freeing of the anondev_t. But since0db10944a76b("nfs: Convert to separately allocated bdi") the bdi has been free implicitly by the sb destruction, so this isn't needed anymore.[...]
This fix is needed to account for new changes to the generic super code. So I'll put this into the same set of fixes as the mtd superblock changes. The plan is to have this all fixed up before -rc1 is out.
---
Applied to the vfs.super branch of the vfs/vfs.git tree. Patches in the vfs.super branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.super
[1/1] NFS: switch back to using kill_anon_super
https://git.kernel.org/vfs/vfs/c/db80f8437753
Quoted 8 lines · Christoph Hellwig
NFS switch to open coding
kill_anon_superin7b14a213890a("nfs: don't callbdi_unregister") to avoid the extrabdi_unregistercall. At that pointbdi_destroywas called innfs_free_serverand thus it required a later freeing of the anondev_t. But since0db10944a76b("nfs: Convert to separately allocated bdi") the bdi has been free implicitly by the sb destruction, so this isn't needed anymore.
Quoted 5 lines
By not open coding
kill_anon_super, nfs now inherits the fix indc3216b14160("super: ensure valid info"), and we remove the only open coded version ofkill_anon_super.Signed-off-by Christoph Hellwig <[email protected]>
Looks good to me. Feel free to add:
Honza
Quoted 28 lines
--- fs/nfs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)fs/nfs/super.c +1
-3@@ -1339,15 +1339,13 @@ int nfs_get_tree_common(struct fs_context *fc)void nfs_kill_super (struct super_block *s) {struct nfs_server *server =NFS_SB (s); -dev_t dev = s->s_dev;nfs_sysfs_move_sb_to_server (server); -generic_shutdown_super (s); +kill_anon_super (s);nfs_fscache_release_super_cookie (s);nfs_free_server (server); -free_anon_bdev (dev); }EXPORT_SYMBOL_GPL (nfs_kill_super);Signature · 1 line
2.39.2
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 28 lines · Christoph Hellwig
NFS switch to open coding
kill_anon_superin7b14a213890a("nfs: don't callbdi_unregister") to avoid the extrabdi_unregistercall. At that pointbdi_destroywas called innfs_free_serverand thus it required a later freeing of the anondev_t. But since0db10944a76b("nfs: Convert to separately allocated bdi") the bdi has been free implicitly by the sb destruction, so this isn't needed anymore.By not open coding
kill_anon_super, nfs now inherits the fix indc3216b14160("super: ensure valid info"), and we remove the only open coded version ofkill_anon_super.Signed-off-by Christoph Hellwig <[email protected]>--- fs/nfs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)fs/nfs/super.c +0
-1@@ -1339,15 +1339,13 @@ int nfs_get_tree_common(struct fs_context *fc)void nfs_kill_super (struct super_block *s) {struct nfs_server *server =NFS_SB (s); -dev_t dev = s->s_dev;nfs_sysfs_move_sb_to_server (server);
fs/nfs/super.c int nfs_get_tree_common(struct fs_context *fc) · line 1351
Quoted 10 lines
fs/nfs/super.c +1
-2-generic_shutdown_super (s); +kill_anon_super (s);nfs_fscache_release_super_cookie (s);nfs_free_server (server); -free_anon_bdev (dev); }EXPORT_SYMBOL_GPL (nfs_kill_super);
Nice. Long overdue. This also might explain why ceph was once this way before we changed it here:
470a5c77eac0 ceph: use kill_anon_super helper
In any case:
Quoted 4 lines · Jeff Layton
Nice. Long overdue. This also might explain why ceph was once this way before we changed it here:
470a5c77eac0ceph: usekill_anon_superhelper
Yes, that looks like the same workaround for bdi lifetimes.