Revert "ANDROID: fuse: Support errors from fuse daemon in canonical path"

This reverts commit db88745171.

Reason for revert: This changes KMI, and thus must be submitted as later

Change-Id: I879033c8df10e31d245d50718edccae99f12df38
This commit is contained in:
Paul Lawrence
2023-03-31 16:51:29 +00:00
committed by Gerrit Code Review
parent db88745171
commit 85e06e0356
6 changed files with 2733 additions and 2744 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1941,7 +1941,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud,
err = copy_out_args(cs, req->args, nbytes);
fuse_copy_finish(cs);
if (!err && req->in.h.opcode == FUSE_CANONICAL_PATH && !oh.error) {
if (!err && req->in.h.opcode == FUSE_CANONICAL_PATH) {
char *path = (char *)req->args->out_args[0].value;
path[req->args->out_args[0].size - 1] = 0;

View File

@@ -395,7 +395,7 @@ static struct vfsmount *fuse_dentry_automount(struct path *path)
* look up paths on its own. Instead, we handle the lookup as a special case
* inside of the write request.
*/
static int fuse_dentry_canonical_path(const struct path *path,
static void fuse_dentry_canonical_path(const struct path *path,
struct path *canonical_path)
{
struct inode *inode = d_inode(path->dentry);
@@ -414,12 +414,12 @@ static int fuse_dentry_canonical_path(const struct path *path,
fuse_canonical_path_finalize, path,
canonical_path);
if (fer.ret)
return PTR_ERR(fer.result);
return;
#endif
path_name = (char *)get_zeroed_page(GFP_KERNEL);
if (!path_name)
return -ENOMEM;
goto default_path;
args.opcode = FUSE_CANONICAL_PATH;
args.nodeid = get_node_id(inode);
@@ -433,14 +433,11 @@ static int fuse_dentry_canonical_path(const struct path *path,
err = fuse_simple_request(fm, &args);
free_page((unsigned long)path_name);
if (err > 0)
return 0;
if (err < 0)
return err;
return;
default_path:
canonical_path->dentry = path->dentry;
canonical_path->mnt = path->mnt;
path_get(canonical_path);
return 0;
}
const struct dentry_operations fuse_dentry_operations = {

View File

@@ -763,11 +763,8 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
/* support stacked filesystems */
if (path.dentry && path.dentry->d_op) {
if (path.dentry->d_op->d_canonical_path) {
ret = path.dentry->d_op->d_canonical_path(&path,
path.dentry->d_op->d_canonical_path(&path,
&alteredpath);
if (ret)
goto path_put_and_out;
canonical_path = &alteredpath;
path_put(&path);
}
@@ -779,7 +776,6 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
/* create/update an inode mark */
ret = inotify_update_watch(group, inode, mask);
path_put_and_out:
path_put(canonical_path);
fput_and_out:
fdput(f);

View File

@@ -153,7 +153,7 @@ struct dentry_operations {
struct vfsmount *(*d_automount)(struct path *);
int (*d_manage)(const struct path *, bool);
struct dentry *(*d_real)(struct dentry *, const struct inode *);
int (*d_canonical_path)(const struct path *, struct path *);
void (*d_canonical_path)(const struct path *, struct path *);
ANDROID_KABI_RESERVE(1);
ANDROID_KABI_RESERVE(2);
ANDROID_KABI_RESERVE(3);

View File

@@ -105,11 +105,7 @@ static inline int fsnotify_file(struct file *file, __u32 mask)
struct path lower_path;
int ret;
ret = path->dentry->d_op->d_canonical_path(path,
&lower_path);
if (ret)
return ret;
path->dentry->d_op->d_canonical_path(path, &lower_path);
ret = fsnotify_parent(lower_path.dentry, mask,
&lower_path, FSNOTIFY_EVENT_PATH);
path_put(&lower_path);