From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH 1/2] iomap: fiemap should honor the FIEMAP_FLAG_SYNC flag
Date: Mon, 8 Aug 2016 16:22:30 +1000 [thread overview]
Message-ID: <1470637351-27933-2-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1470637351-27933-1-git-send-email-david@fromorbit.com>
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 48141b8..189742b 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -470,9 +470,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.8.0.rc3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-08-08 6:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-08 6:22 [PATCH 0/2] iomap: fixes for fiemap interface Dave Chinner
2016-08-08 6:22 ` Dave Chinner [this message]
2016-08-09 7:28 ` [PATCH 1/2] iomap: fiemap should honor the FIEMAP_FLAG_SYNC flag Christoph Hellwig
2016-08-08 6:22 ` [PATCH 2/2] iomap: add fiemap support for attribute mappings Dave Chinner
2016-08-09 7:34 ` Christoph Hellwig
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=1470637351-27933-2-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=linux-fsdevel@vger.kernel.org \
--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