* [RFC PATCH] fiemap-tester.c: Do not error out when FIEMAP_EXTENT_NOT_ALIGNED is set and extent is aligned.
@ 2015-04-15 13:29 Chandan Rajendra
2015-04-15 23:42 ` Dave Chinner
0 siblings, 1 reply; 2+ messages in thread
From: Chandan Rajendra @ 2015-04-15 13:29 UTC (permalink / raw)
To: fstests; +Cc: Chandan Rajendra, linux-fsdevel, chandan
>From Linux kernel's Documentation/filesystems/fiemap.txt,
* FIEMAP_EXTENT_NOT_ALIGNED
Extent offsets and length are not guaranteed to be block aligned.
So this means that FIEMAP_EXTENT_NOT_ALIGNED is just a hint that indicates
that the extent range could possibly be out of alignment w.r.t to the
filesystem's blocksize. It should still be possible for fiemap ioctl to return
extents with FIEMAP_EXTENT_NOT_ALIGNED flag set (e.g. Inline extents) but
which have blocksize aligned ranges.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
---
src/fiemap-tester.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/src/fiemap-tester.c b/src/fiemap-tester.c
index 8e633ab..74dea17 100644
--- a/src/fiemap-tester.c
+++ b/src/fiemap-tester.c
@@ -195,17 +195,6 @@ check_flags(struct fiemap *fiemap, int blocksize)
return -1;
}
- if (extent->fe_flags & FIEMAP_EXTENT_NOT_ALIGNED &&
- aligned_offset == extent->fe_physical &&
- aligned_length == extent->fe_length) {
- printf("ERROR: FIEMAP_EXTENT_NOT_ALIGNED is set but "
- "offset and length is blocksize aligned: "
- "%llu\n",
- (unsigned long long)
- (extent->fe_logical / blocksize));
- return -1;
- }
-
if (extent->fe_flags & FIEMAP_EXTENT_LAST &&
c + 1 < fiemap->fm_mapped_extents) {
printf("ERROR: FIEMAP_EXTENT_LAST is set but there are"
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC PATCH] fiemap-tester.c: Do not error out when FIEMAP_EXTENT_NOT_ALIGNED is set and extent is aligned.
2015-04-15 13:29 [RFC PATCH] fiemap-tester.c: Do not error out when FIEMAP_EXTENT_NOT_ALIGNED is set and extent is aligned Chandan Rajendra
@ 2015-04-15 23:42 ` Dave Chinner
0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2015-04-15 23:42 UTC (permalink / raw)
To: Chandan Rajendra; +Cc: fstests, linux-fsdevel, chandan
On Wed, Apr 15, 2015 at 06:59:53PM +0530, Chandan Rajendra wrote:
> From Linux kernel's Documentation/filesystems/fiemap.txt,
>
> * FIEMAP_EXTENT_NOT_ALIGNED
> Extent offsets and length are not guaranteed to be block aligned.
>
> So this means that FIEMAP_EXTENT_NOT_ALIGNED is just a hint that indicates
> that the extent range could possibly be out of alignment w.r.t to the
> filesystem's blocksize. It should still be possible for fiemap ioctl to return
> extents with FIEMAP_EXTENT_NOT_ALIGNED flag set (e.g. Inline extents) but
> which have blocksize aligned ranges.
Perhaps, but if the inline extent is blocksize aligned, then it's
aligned data, and so FIEMAP_EXTENT_NOT_ALIGNED should not be set.
This is regression test code - we want to error out when the hints
are not correct, thereby telling the developer they haven't got
their logic correct. Indeed, we may have inadvertantly broken it,
and this check will tell us that.
i.e. If we set FIEMAP_EXTENT_NOT_ALIGNED in kernel code, you do
it because we the extent is not aligned. There's no "grey area" here;
the filesystem knows if the data is not aligned, and so should be
setting the appropriate flags to tell fiemap_fill_next_extent() that
it is unaligned data. Getting this wrong is a *bug* in the
filesystem's fiemap implementation, and that's what a regression
test suite is supposed to expose.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-15 23:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-15 13:29 [RFC PATCH] fiemap-tester.c: Do not error out when FIEMAP_EXTENT_NOT_ALIGNED is set and extent is aligned Chandan Rajendra
2015-04-15 23:42 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).