diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c index c0ae3069c6c8..2449558bac18 100644 --- a/fs/fuse/passthrough.c +++ b/fs/fuse/passthrough.c @@ -214,7 +214,8 @@ int fuse_passthrough_open(struct fuse_dev *fud, u32 lower_fd) } if (!passthrough_filp->f_op->read_iter || - !passthrough_filp->f_op->write_iter) { + !((passthrough_filp->f_path.mnt->mnt_flags | MNT_READONLY) || + passthrough_filp->f_op->write_iter)) { pr_err("FUSE: passthrough file misses file operations.\n"); res = -EBADF; goto err_free_file;