Revert "ANDROID: Incremental fs: Don't allow renaming .index directory."

This reverts commit 85e158e3e1.

Set incfs back to rvc shipping incfs

Bug: 178509184
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Id119ffb4da700bd28baad5c303a6369311b2b3f5
This commit is contained in:
Paul Lawrence
2021-01-26 13:31:12 -08:00
parent 6fe44a54fa
commit ccb9435403
2 changed files with 2 additions and 24 deletions

View File

@@ -780,8 +780,7 @@ static struct dentry *open_or_create_index_dir(struct dentry *backing_dir)
if (err)
return ERR_PTR(err);
if (!d_really_is_positive(index_dentry) ||
unlikely(d_unhashed(index_dentry))) {
if (!d_really_is_positive(index_dentry)) {
dput(index_dentry);
return ERR_PTR(-EINVAL);
}
@@ -1647,8 +1646,7 @@ static int dir_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
if (!err) {
struct inode *inode = NULL;
if (d_really_is_negative(backing_dentry) ||
unlikely(d_unhashed(backing_dentry))) {
if (d_really_is_negative(backing_dentry)) {
err = -EINVAL;
goto out;
}
@@ -1873,13 +1871,6 @@ static int dir_rename(struct inode *old_dir, struct dentry *old_dentry,
return error;
backing_old_dentry = get_incfs_dentry(old_dentry)->backing_path.dentry;
if (!backing_old_dentry || backing_old_dentry == mi->mi_index_dir) {
/* Renaming .index not allowed */
error = -EBUSY;
goto exit;
}
backing_new_dentry = get_incfs_dentry(new_dentry)->backing_path.dentry;
dget(backing_old_dentry);
dget(backing_new_dentry);
@@ -1926,7 +1917,6 @@ out:
dput(backing_new_dentry);
dput(backing_old_dentry);
exit:
mutex_unlock(&mi->mi_dir_struct_mutex);
if (error)
pr_debug("incfs: %s err:%d\n", __func__, error);

View File

@@ -837,12 +837,6 @@ static int cant_touch_index_test(const char *mount_dir)
goto failure;
}
err = rmdir(index_path);
if (err == 0 || errno != EBUSY) {
print_error(".index directory should not be removed\n");
goto failure;
}
err = emit_file(cmd_fd, ".index", file_name, &file_id,
file_size, NULL);
if (err != -EBUSY) {
@@ -877,12 +871,6 @@ static int cant_touch_index_test(const char *mount_dir)
goto failure;
}
err = rename(index_path, dst_name);
if (err == 0 || errno != EBUSY) {
print_error("Shouldn't rename .index directory\n");
goto failure;
}
close(cmd_fd);
free(subdir);
free(index_path);