Re: [RFC PATCH] fiemap-tester.c: Do not error out when FIEMAP_EXTENT_NOT_ALIGNED is set and extent is aligned.

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



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@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux