diff options
author | Amir Goldstein <amir73il@gmail.com> | 2024-02-01 16:38:06 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2024-02-23 19:36:32 +0300 |
commit | d2c487f150ae00e3cb9faf57aceacc584e0a130c (patch) | |
tree | ac1ca5774d3ac29b9e3af1c58d437e7c34c4b94c /fs/fuse/dir.c | |
parent | 7de64d521bf92396b7da8ae0600188ea5d75a4c9 (diff) | |
download | linux-d2c487f150ae00e3cb9faf57aceacc584e0a130c.tar.xz |
fuse: prepare for failing open response
In preparation for inode io modes, a server open response could fail due to
conflicting inode io modes.
Allow returning an error from fuse_finish_open() and handle the error in
the callers.
fuse_finish_open() is used as the callback of finish_open(), so that
FMODE_OPENED will not be set if fuse_finish_open() fails.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 66873be14670..1225df59d9b7 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -692,13 +692,15 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, d_instantiate(entry, inode); fuse_change_entry_timeout(entry, &outentry); fuse_dir_changed(dir); - err = finish_open(file, entry, generic_file_open); + err = generic_file_open(inode, file); + if (!err) { + file->private_data = ff; + err = finish_open(file, entry, fuse_finish_open); + } if (err) { fi = get_fuse_inode(inode); fuse_sync_release(fi, ff, flags); } else { - file->private_data = ff; - fuse_finish_open(inode, file); if (fm->fc->atomic_o_trunc && trunc) truncate_pagecache(inode, 0); else if (!(ff->open_flags & FOPEN_KEEP_CACHE)) |