public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: xfs@oss.sgi.com
Cc: Dave Chinner <dchinner@redhat.com>
Subject: [PATCH 3/7] iomap: fiemap should honor the FIEMAP_FLAG_SYNC flag
Date: Sat, 13 Aug 2016 16:42:57 -0700	[thread overview]
Message-ID: <1471131781-14107-4-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1471131781-14107-1-git-send-email-hch@lst.de>

From: Dave Chinner <dchinner@redhat.com>

The flag is checked as supported, but then we do an unconditional
sync of the file, regardless of whether the flag is set or not. Make
the sync conditional on having the FIEMAP_FLAG_SYNC flag set.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 fs/iomap.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/iomap.c b/fs/iomap.c
index 74712e2..56c19e6 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -467,9 +467,11 @@ int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fi,
 	if (ret)
 		return ret;
 
-	ret = filemap_write_and_wait(inode->i_mapping);
-	if (ret)
-		return ret;
+	if (fi->fi_flags & FIEMAP_FLAG_SYNC) {
+		ret = filemap_write_and_wait(inode->i_mapping);
+		if (ret)
+			return ret;
+	}
 
 	while (len > 0) {
 		ret = iomap_apply(inode, start, len, 0, ops, &ctx,
-- 
2.1.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2016-08-13 23:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-13 23:42 first set of iomap fix Christoph Hellwig
2016-08-13 23:42 ` [PATCH 1/7] iomap: remove superflous mark_page_accessed from iomap_write_actor Christoph Hellwig
2016-08-13 23:42 ` [PATCH 2/7] iomap: remove superflous pagefault_disable " Christoph Hellwig
2016-08-13 23:42 ` Christoph Hellwig [this message]
2016-08-13 23:42 ` [PATCH 4/7] iomap: prepare iomap_fiemap for attribute mappings Christoph Hellwig
2016-08-13 23:42 ` [PATCH 5/7] iomap: mark ->iomap_end as optional Christoph Hellwig
2016-08-13 23:43 ` [PATCH 6/7] xfs: simplify xfs_file_iomap_begin Christoph Hellwig
2016-08-13 23:43 ` [PATCH 7/7] xfs: (re-)implement FIEMAP_FLAG_XATTR Christoph Hellwig
2016-08-14  6:33 ` first set of iomap fix Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471131781-14107-4-git-send-email-hch@lst.de \
    --to=hch@lst.de \
    --cc=dchinner@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox