From fe0c18d0f08da58acf328686a0c78682b54de6b8 Mon Sep 17 00:00:00 2001 From: Tadeusz Struk Date: Wed, 26 Jan 2022 13:09:39 -0800 Subject: [PATCH] ANDROID: incremental-fs: remove index and incomplete dir on umount Cleanup incremental-fs left overs on umount, otherwise incr-fs will complain as below: BUG: Dentry {i=47a,n=.incomplete} still in use [unmount of incremental-fs] This requires vfs_rmdir() of the special index dir. Since set_anon_super() was used in incfs_mount_fs() the incfs_kill_sb() should use kill_anon_super() instead of generic_shutdown_super() otherwise it will leak the pseudo dev_t that set_anon_super() allocates. Bug: 211066171 Signed-off-by: Tadeusz Struk Change-Id: I7ea54db63513fc130e1997cbf79121015ee12405 --- fs/incfs/vfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/incfs/vfs.c b/fs/incfs/vfs.c index 8d4c4e39fa46..ceb0c2e41402 100644 --- a/fs/incfs/vfs.c +++ b/fs/incfs/vfs.c @@ -2269,7 +2269,7 @@ struct dentry *incfs_mount_fs(struct file_system_type *type, int flags, goto err; } - path_put(&backing_dir_path); + mi->mi_backing_dir_path = backing_dir_path; sb->s_flags |= SB_ACTIVE; pr_debug("incfs: mount\n"); @@ -2309,8 +2309,9 @@ void incfs_kill_sb(struct super_block *sb) struct mount_info *mi = sb->s_fs_info; pr_debug("incfs: unmount\n"); + vfs_rmdir(d_inode(mi->mi_backing_dir_path.dentry), mi->mi_index_dir); + kill_anon_super(sb); incfs_free_mount_info(mi); - generic_shutdown_super(sb); sb->s_fs_info = NULL; }