Return-Path: Received: from mail-qt0-f195.google.com ([209.85.216.195]:34301 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751398AbdHGPvd (ORCPT ); Mon, 7 Aug 2017 11:51:33 -0400 Received: by mail-qt0-f195.google.com with SMTP id i19so854422qte.1 for ; Mon, 07 Aug 2017 08:51:33 -0700 (PDT) From: nate@neworld.us To: fuse-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Cc: Vitaly Zolotusky , Nate Clark Subject: [PATCH] fs/fuse: Call generic_write_sync after fuse write Date: Mon, 7 Aug 2017 11:46:45 -0400 Message-Id: <20170807154645.15038-1-nate@neworld.us> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Vitaly Zolotusky If the IOCB_DSYNC flag is set a sync is not being performed by fuse_file_write_iter. Honor IOCB_DSYNC by invoking generic_write_sync when a write has been successful. generic_write_sync appropriatly syncs the data which was written when IOCB_DSYNC flag is set. Signed-off-by: Vitaly Zolotusky Signed-off-by: Nate Clark --- fs/fuse/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 3ee4fdc..5e0a39e 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1227,6 +1227,8 @@ static ssize_t fuse_file_write_iter(struct kiocb *iocb, struct iov_iter *from) out: current->backing_dev_info = NULL; inode_unlock(inode); + if (written > 0) + written = generic_write_sync(iocb, written); return written ? written : err; } -- 2.9.4