Skip to content

Commit

Permalink
Automatic merge of 'master' into merge (2023-07-21 10:19)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed Jul 21, 2023
2 parents b33ef67 + bfa3037 commit a06d4dc
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
4 changes: 1 addition & 3 deletions fs/fuse/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
spin_unlock(&fi->lock);
}
kfree(forget);
if (ret == -ENOMEM)
if (ret == -ENOMEM || ret == -EINTR)
goto out;
if (ret || fuse_invalid_attr(&outarg.attr) ||
fuse_stale_inode(inode, outarg.generation, &outarg.attr))
Expand Down Expand Up @@ -395,8 +395,6 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name
goto out_put_forget;

err = -EIO;
if (!outarg->nodeid)
goto out_put_forget;
if (fuse_invalid_attr(&outarg->attr))
goto out_put_forget;

Expand Down
8 changes: 6 additions & 2 deletions fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,10 @@ static void process_init_reply(struct fuse_mount *fm, struct fuse_args *args,
process_init_limits(fc, arg);

if (arg->minor >= 6) {
u64 flags = arg->flags | (u64) arg->flags2 << 32;
u64 flags = arg->flags;

if (flags & FUSE_INIT_EXT)
flags |= (u64) arg->flags2 << 32;

ra_pages = arg->max_readahead / PAGE_SIZE;
if (flags & FUSE_ASYNC_READ)
Expand Down Expand Up @@ -1254,7 +1257,8 @@ void fuse_send_init(struct fuse_mount *fm)
FUSE_ABORT_ERROR | FUSE_MAX_PAGES | FUSE_CACHE_SYMLINKS |
FUSE_NO_OPENDIR_SUPPORT | FUSE_EXPLICIT_INVAL_DATA |
FUSE_HANDLE_KILLPRIV_V2 | FUSE_SETXATTR_EXT | FUSE_INIT_EXT |
FUSE_SECURITY_CTX | FUSE_CREATE_SUPP_GROUP;
FUSE_SECURITY_CTX | FUSE_CREATE_SUPP_GROUP |
FUSE_HAS_EXPIRE_ONLY;
#ifdef CONFIG_FUSE_DAX
if (fm->fc->dax)
flags |= FUSE_MAP_ALIGNMENT;
Expand Down
21 changes: 13 additions & 8 deletions fs/fuse/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,23 @@
#include <linux/compat.h>
#include <linux/fileattr.h>

static ssize_t fuse_send_ioctl(struct fuse_mount *fm, struct fuse_args *args)
static ssize_t fuse_send_ioctl(struct fuse_mount *fm, struct fuse_args *args,
struct fuse_ioctl_out *outarg)
{
ssize_t ret = fuse_simple_request(fm, args);
ssize_t ret;

args->out_args[0].size = sizeof(*outarg);
args->out_args[0].value = outarg;

ret = fuse_simple_request(fm, args);

/* Translate ENOSYS, which shouldn't be returned from fs */
if (ret == -ENOSYS)
ret = -ENOTTY;

if (ret >= 0 && outarg->result == -ENOSYS)
outarg->result = -ENOTTY;

return ret;
}

Expand Down Expand Up @@ -264,13 +273,11 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg,
}

ap.args.out_numargs = 2;
ap.args.out_args[0].size = sizeof(outarg);
ap.args.out_args[0].value = &outarg;
ap.args.out_args[1].size = out_size;
ap.args.out_pages = true;
ap.args.out_argvar = true;

transferred = fuse_send_ioctl(fm, &ap.args);
transferred = fuse_send_ioctl(fm, &ap.args, &outarg);
err = transferred;
if (transferred < 0)
goto out;
Expand Down Expand Up @@ -399,12 +406,10 @@ static int fuse_priv_ioctl(struct inode *inode, struct fuse_file *ff,
args.in_args[1].size = inarg.in_size;
args.in_args[1].value = ptr;
args.out_numargs = 2;
args.out_args[0].size = sizeof(outarg);
args.out_args[0].value = &outarg;
args.out_args[1].size = inarg.out_size;
args.out_args[1].value = ptr;

err = fuse_send_ioctl(fm, &args);
err = fuse_send_ioctl(fm, &args, &outarg);
if (!err) {
if (outarg.result < 0)
err = outarg.result;
Expand Down
3 changes: 3 additions & 0 deletions include/uapi/linux/fuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
* - add extension header
* - add FUSE_EXT_GROUPS
* - add FUSE_CREATE_SUPP_GROUP
* - add FUSE_HAS_EXPIRE_ONLY
*/

#ifndef _LINUX_FUSE_H
Expand Down Expand Up @@ -369,6 +370,7 @@ struct fuse_file_lock {
* FUSE_HAS_INODE_DAX: use per inode DAX
* FUSE_CREATE_SUPP_GROUP: add supplementary group info to create, mkdir,
* symlink and mknod (single group that matches parent)
* FUSE_HAS_EXPIRE_ONLY: kernel supports expiry-only entry invalidation
*/
#define FUSE_ASYNC_READ (1 << 0)
#define FUSE_POSIX_LOCKS (1 << 1)
Expand Down Expand Up @@ -406,6 +408,7 @@ struct fuse_file_lock {
#define FUSE_SECURITY_CTX (1ULL << 32)
#define FUSE_HAS_INODE_DAX (1ULL << 33)
#define FUSE_CREATE_SUPP_GROUP (1ULL << 34)
#define FUSE_HAS_EXPIRE_ONLY (1ULL << 35)

/**
* CUSE INIT request/reply flags
Expand Down

0 comments on commit a06d4dc

Please sign in to comment.