summaryrefslogtreecommitdiffstats
path: root/fs/fuse/cuse.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2017-09-12 16:57:53 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2017-09-12 16:57:53 +0200
commite1c0eecba1a4154c35c400f1cc9a035e6246bbcd (patch)
treec13747b8adb3435b46c1c65647d5f7ab173cc0a7 /fs/fuse/cuse.c
parent5d6d3a301c4e749e04be6fcdcf4cb1ffa8bae524 (diff)
downloadop-kernel-dev-e1c0eecba1a4154c35c400f1cc9a035e6246bbcd.zip
op-kernel-dev-e1c0eecba1a4154c35c400f1cc9a035e6246bbcd.tar.gz
fuse: honor iocb sync flags on write
If the IOCB_DSYNC flag is set a sync is not being performed by fuse_file_write_iter. Honor IOCB_DSYNC/IOCB_SYNC by setting O_DYSNC/O_SYNC respectively in the flags filed of the write request. We don't need to sync data or metadata, since fuse_perform_write() does write-through and the filesystem is responsible for updating file times. Original patch by Vitaly Zolotusky. Reported-by: Nate Clark <nate@neworld.us> Cc: Vitaly Zolotusky <vitaly@unitc.com>. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/cuse.c')
-rw-r--r--fs/fuse/cuse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
index c5b6b71..e9e9780 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
@@ -90,7 +90,7 @@ static struct list_head *cuse_conntbl_head(dev_t devt)
static ssize_t cuse_read_iter(struct kiocb *kiocb, struct iov_iter *to)
{
- struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(kiocb->ki_filp);
+ struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(kiocb);
loff_t pos = 0;
return fuse_direct_io(&io, to, &pos, FUSE_DIO_CUSE);
@@ -98,7 +98,7 @@ static ssize_t cuse_read_iter(struct kiocb *kiocb, struct iov_iter *to)
static ssize_t cuse_write_iter(struct kiocb *kiocb, struct iov_iter *from)
{
- struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(kiocb->ki_filp);
+ struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(kiocb);
loff_t pos = 0;
/*
* No locking or generic_write_checks(), the server is
OpenPOWER on IntegriCloud