Bug 927541 - filefrag: filefrag -v reports wrong extent count
filefrag: filefrag -v reports wrong extent count
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: e2fsprogs (Show other bugs)
6.4
All Linux
low Severity low
: rc
: ---
Assigned To: Eric Sandeen
Petr Beňas
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-26 03:35 EDT by Eryu Guan
Modified: 2015-01-04 18:04 EST (History)
5 users (show)

See Also:
Fixed In Version: e2fsprogs-1.41.12-15.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 17:43:46 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eryu Guan 2013-03-26 03:35:20 EDT
Description of problem:
[root@hp-dl388g8-01 ~]# dd if=/dev/zero of=testfile bs=$block_size count=1 seek=$((2**32 - 2))
[root@hp-dl388g8-01 ~]# filefrag testfile
testfile: 1 extent found            <====== 1 extent in non-verbose mode
[root@hp-dl388g8-01 ~]# filefrag -v testfile
Filesystem type is: ef53
File size of testfile is 17592186040320 (4294967295 blocks, blocksize 4096)
 ext   logical physical expected length flags
   0 4294967294 11188222               1 eof
testfile: 2 extents found           <======= 2 extents in verbose mode

Version-Release number of selected component (if applicable):
e2fsprogs-1.41.12-14.el6

How reproducible:
always

Steps to Reproduce:
1.dd if=/dev/zero of=testfile bs=$block_size count=1 seek=$((2**32 - 2))
2.filefrag testfile
3.filefrag -v testfile
  
Actual results:
filefrag -v reports 2 extents for testfile

Expected results:
1 extent

Additional info:
e2fsprogs on RHEL7 doesn't have this issue, also e2fsprogs from F18
Comment 1 Eric Sandeen 2013-06-06 13:18:23 EDT
There are a lot of upstream filefrag fixes, I'll pull them all in w/ this bug.

339e457939bf1663ac2dbd52e47cd6e145726771 filefrag: fix segfault on virtual fs
036fda6d487737eac9be086d999b7480a81d37ea filefrag: fix report of number of extents
605cf6edaf6fce6a3810cda24c6ceca90af1a096 filefrag: fix infinite loop in filefrag
9c58eaf7d3a47d83945bd3756271e7ae675b25e1 filefrag: fix an off by one error in when printing the next expected block
a00be17e4768c5ce55f74be518f35f5d5d1b158b filefrag: Display the number of contiguous, not physical, extents
1e003cc77d43ee01eeaae962ff6d264c9a74a363 filefrag: Fix uninitialized "expected" value
a8d8432b584c222dc7960c15cd7b9acbc7c72352 filefrag: count 0 extents properly when verbose
b637f8e7ed4309ec39d87ea0cf07f48fc0610266 filefrag: remove useless assignment
Comment 7 Eric Sandeen 2013-06-26 11:18:32 EDT
One thing that should possibly be added to the test is a "sync" (or umount/remount) after creating the file which filefrag inspects.  Otherwise differences with respect to delayed allocation (which is all kernel behavior) may influence the test.

See how the answer changes after a sync for a freshly-created file:

[root@bp-05 tmp]# filefrag -v $mnt/testfile
Filesystem type is: ef53
File size of /mnt/bz927541/testfile is 17592186040320 (4294967295 blocks, blocksize 4096)
/mnt/bz927541/testfile: 0 extents found

[root@bp-05 tmp]# sync

[root@bp-05 tmp]# filefrag -v $mnt/testfile
Filesystem type is: ef53
File size of /mnt/bz927541/testfile is 17592186040320 (4294967295 blocks, blocksize 4096)
 ext   logical physical expected length flags
   0 4294967294     1550               1 eof
/mnt/bz927541/testfile: 2 extents found
Comment 8 Eric Sandeen 2013-06-26 11:27:48 EDT
I think that seeing 2 extents not one (above) was a local problem here; re-installing the brew-built packages, I see one extent as I should.

Adding syncs to the test will take kernelside delalloc behavior out of the mix, and I hope the test will pass.

Thanks,
-Eric
Comment 12 Petr Beňas 2013-08-13 05:31:14 EDT
Reproduced in e2fsprogs-1.41.12-14.el6.x86_64 and verified in e2fsprogs-1.41.12-15.el6.x86_64.
Comment 13 errata-xmlrpc 2013-11-21 17:43:46 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1689.html

Note You need to log in before you can comment on or make changes to this bug.