All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: Don't trim file extents during iomap
@ 2017-11-23 11:40 Nikolay Borisov
  2017-11-23 13:26 ` Christoph Hellwig
  2017-11-27 17:44 ` Darrick J. Wong
  0 siblings, 2 replies; 9+ messages in thread
From: Nikolay Borisov @ 2017-11-23 11:40 UTC (permalink / raw)
  To: linux-xfs, hch; +Cc: sandeen, darrick.wong, Nikolay Borisov

For file extents xfs currently calls xfs_bmapi_read with flag set to 0,
meaning extents are going to be truncated to the requested range. Since the
same codepath is used for fiemap this means xfs is special in that regard, since
other filesystems (ext4/btrfs) do not trim extents for fiemap. Make the behavior
consistent by always passing XFS_BMAPI_ENTIRE. A full xfstest run validated that
this doesn't regress on ordinary read/write IO.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/xfs/xfs_iomap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index f179bdf1644d..8942324a4d3d 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -1008,7 +1008,7 @@ xfs_file_iomap_begin(
 	end_fsb = XFS_B_TO_FSB(mp, offset + length);
 
 	error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
-			       &nimaps, 0);
+			       &nimaps, XFS_BMAPI_ENTIRE);
 	if (error)
 		goto out_unlock;
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-11-29 19:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-23 11:40 [PATCH] xfs: Don't trim file extents during iomap Nikolay Borisov
2017-11-23 13:26 ` Christoph Hellwig
2017-11-27 17:44 ` Darrick J. Wong
2017-11-28  1:47   ` Darrick J. Wong
2017-11-28  6:46     ` Nikolay Borisov
2017-11-29  2:30       ` Darrick J. Wong
2017-11-29 19:57         ` Christoph Hellwig
2017-11-28  7:05     ` Nikolay Borisov
2017-11-28  9:17     ` Nikolay Borisov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.