[Devel] [PATCH RHEL7 COMMIT] Revert "nfs: skip bdi_unregister() if inodes are leaked."

Konstantin Khorenko khorenko at virtuozzo.com
Mon Sep 30 11:45:26 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.27.2.vz7.107.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.27.2.vz7.107.10
------>
commit e66474840f3f5f3631f13064c376d54421fa6777
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Mon Sep 30 11:40:59 2019 +0300

    Revert "nfs: skip bdi_unregister() if inodes are leaked."
    
    This reverts commit 77335e3fc2f3ebea843b6c371ad8a6436b68cc00.
    
    The original patch is simply wrong and as the patch series
    helped to avoid panics, the patch is simply not needed at
    all.
    
    First hunk of the patch misses "return" after leaked inodes
    are detected, second hunk does free bdev in case _there are_
    leaks detected - quite opposite to the original idea.
    
    https://jira.sw.ru/browse/PSBM-95177
    
    Found-by: Evgenii Shatokhin <eshatokhin at virtuozzo.com>
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/nfs/super.c | 3 ---
 fs/super.c     | 3 +--
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index f9c0a02c25af..64b52b7188c9 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2711,9 +2711,6 @@ void nfs_put_super(struct super_block *s)
 {
 	struct nfs_server *server = NFS_SB(s);
 
-	if (!list_empty(&s->s_inodes))
-		pr_err("nfs_put_super: busy inodes skip bdi_unregister\n");
-
 	bdi_unregister(&server->backing_dev_info);
 }
 EXPORT_SYMBOL_GPL(nfs_put_super);
diff --git a/fs/super.c b/fs/super.c
index e5551b8462a8..f131d14587ca 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1046,8 +1046,7 @@ void kill_anon_super(struct super_block *sb)
 {
 	dev_t dev = sb->s_dev;
 	generic_shutdown_super(sb);
-	if (!list_empty(&sb->s_inodes))
-		free_anon_bdev(dev);
+	free_anon_bdev(dev);
 }
 
 EXPORT_SYMBOL(kill_anon_super);



More information about the Devel mailing list