The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear 
at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.44
------>
commit ee50ec2dadd400c7744ddae256d5424a7131fc00
Author: Andrey Ryabinin <[email protected]>
Date:   Thu Jun 17 18:18:01 2021 +0300

    fs/super: don't destroy super_block in case of leaked inodes
    
    In case of leaked inode don't destroy superblock to decrease
    possibility of crash.
    
    https://jira.sw.ru/browse/PSBM-95177
    Signed-off-by: Andrey Ryabinin <[email protected]>
    
    (cherry picked from vz7 commit 1e96054ee10b ("fs/super: don't destroy
    super_block in case of leaked inodes"))
    
    Signed-off-by: Andrey Zhadchenko <[email protected]>
---
 fs/super.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/fs/super.c b/fs/super.c
index 4dc309ac42f8..45a5f86a44d4 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -354,7 +354,15 @@ void deactivate_locked_super(struct super_block *s)
                cleancache_invalidate_fs(s);
                unregister_shrinker(&s->s_shrink);
                fs->kill_sb(s);
-
+               if (!list_empty(&s->s_inodes)) {
+                       pr_err("deactivate_locked_super: busy inodes...\n");
+                       spin_lock(&sb_lock);
+                       if (!--s->s_count)
+                               list_del_init(&s->s_list);
+                       spin_unlock(&sb_lock);
+                       up_write(&s->s_umount);
+                       return;
+               }
                /*
                 * Since list_lru_destroy() may sleep, we cannot call it from
                 * put_super(), where we hold the sb_lock. Therefore we destroy
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to