ovl: move freeing ovl_entry past rcu delay
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 2 Oct 2023 02:36:13 +0000 (03:36 +0100)
committerAmir Goldstein <amir73il@gmail.com>
Mon, 2 Oct 2023 14:44:06 +0000 (17:44 +0300)
... into ->free_inode(), that is.

Fixes: 0af950f57fef "ovl: move ovl_entry into ovl_inode"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
fs/overlayfs/super.c

index def266b5e2a33b0aa630662286827227f952e513..f09184b865ec35062bceea88b308622d9f607095 100644 (file)
@@ -167,6 +167,7 @@ static void ovl_free_inode(struct inode *inode)
        struct ovl_inode *oi = OVL_I(inode);
 
        kfree(oi->redirect);
+       kfree(oi->oe);
        mutex_destroy(&oi->lock);
        kmem_cache_free(ovl_inode_cachep, oi);
 }
@@ -176,7 +177,7 @@ static void ovl_destroy_inode(struct inode *inode)
        struct ovl_inode *oi = OVL_I(inode);
 
        dput(oi->__upperdentry);
-       ovl_free_entry(oi->oe);
+       ovl_stack_put(ovl_lowerstack(oi->oe), ovl_numlower(oi->oe));
        if (S_ISDIR(inode->i_mode))
                ovl_dir_cache_free(inode);
        else