mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
ANDROID: Incremental fs: Fix four resource bugs
Without these, you can't unmount a volume on which incfs was mounted and the tests run. Also incfs_tests would fail sporadically without the fix to test_inode Test: Run incfs_test and unmount underlying volume 1000 times Bug: 152636070 Signed-off-by: Paul Lawrence <paullawrence@google.com> Change-Id: I88f11f5d4269c22d9073e5eb671d0c7cc4629f6c
This commit is contained in:
committed by
Alistair Delva
parent
3200d06f78
commit
c062bc8e76
@@ -347,8 +347,8 @@ static int inode_test(struct inode *inode, void *opaque)
|
||||
|
||||
return (node->n_backing_inode == backing_inode) &&
|
||||
inode->i_ino == search->ino;
|
||||
}
|
||||
return 1;
|
||||
} else
|
||||
return inode->i_ino == search->ino;
|
||||
}
|
||||
|
||||
static int inode_set(struct inode *inode, void *opaque)
|
||||
@@ -894,6 +894,7 @@ static int init_new_file(struct mount_info *mi, struct dentry *dentry,
|
||||
}
|
||||
|
||||
bfc = incfs_alloc_bfc(new_file);
|
||||
fput(new_file);
|
||||
if (IS_ERR(bfc)) {
|
||||
error = PTR_ERR(bfc);
|
||||
bfc = NULL;
|
||||
@@ -1676,6 +1677,7 @@ static int final_file_delete(struct mount_info *mi,
|
||||
if (d_really_is_positive(index_file_dentry))
|
||||
error = incfs_unlink(index_file_dentry);
|
||||
out:
|
||||
dput(index_file_dentry);
|
||||
if (error)
|
||||
pr_debug("incfs: delete_file_from_index err:%d\n", error);
|
||||
return error;
|
||||
@@ -1978,6 +1980,7 @@ static void dentry_release(struct dentry *d)
|
||||
|
||||
if (di)
|
||||
path_put(&di->backing_path);
|
||||
kfree(d->d_fsdata);
|
||||
d->d_fsdata = NULL;
|
||||
}
|
||||
|
||||
@@ -2189,7 +2192,7 @@ struct dentry *incfs_mount_fs(struct file_system_type *type, int flags,
|
||||
path_put(&backing_dir_path);
|
||||
sb->s_flags |= SB_ACTIVE;
|
||||
|
||||
pr_debug("infs: mount\n");
|
||||
pr_debug("incfs: mount\n");
|
||||
return dget(sb->s_root);
|
||||
err:
|
||||
sb->s_fs_info = NULL;
|
||||
@@ -2215,7 +2218,7 @@ static int incfs_remount_fs(struct super_block *sb, int *flags, char *data)
|
||||
pr_debug("incfs: new timeout_ms=%d", options.read_timeout_ms);
|
||||
}
|
||||
|
||||
pr_debug("infs: remount\n");
|
||||
pr_debug("incfs: remount\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2223,7 +2226,7 @@ void incfs_kill_sb(struct super_block *sb)
|
||||
{
|
||||
struct mount_info *mi = sb->s_fs_info;
|
||||
|
||||
pr_debug("infs: unmount\n");
|
||||
pr_debug("incfs: unmount\n");
|
||||
incfs_free_mount_info(mi);
|
||||
generic_shutdown_super(sb);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user