Bug 684202 - [PATCH] filefrag: fix verbose output for empty files
Summary: [PATCH] filefrag: fix verbose output for empty files
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: e2fsprogs
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Eric Sandeen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-11 13:03 UTC by Pádraig Brady
Modified: 2011-09-12 20:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-12 20:53:47 UTC
Type: ---


Attachments (Terms of Use)
proposed fix (1.65 KB, patch)
2011-03-11 13:03 UTC, Pádraig Brady
no flags Details | Diff

Description Pádraig Brady 2011-03-11 13:03:02 UTC
Created attachment 483711 [details]
proposed fix

I've sent this to Ted last month, but have heard nothing.
So I'm logging here as I'll forget.

Before:

$ truncate -s 1G file
$ filefrag -v file

Filesystem type is: ef53
File size of file is 1073741824 (262144 blocks, blocksize 4096)
 ext logical physical expected length flags
file: 1 extent found

After:

Filesystem type is: ef53
File size of file is 1073741824 (262144 blocks, blocksize 4096)
file: 0 extents found

Comment 1 Eric Sandeen 2011-03-11 15:02:13 UTC
Thanks, I'll pester Ted too... did you send it to the list?  I don't see anything from you ...

however, this patch on the list last year, also not yet merged:

[PATCH] filefrag: count optimize non-verbose mode; count 0 extents properly when verbose

fixes it as well, I think... I pinged Ted.

Comment 2 Pádraig Brady 2011-03-11 16:16:03 UTC
I did not send it to linux-ext4.org as there was no mention of that list in the e2fsprogs package.  Thanks for reviving this.

Comment 3 Eric Sandeen 2011-05-05 18:21:39 UTC
Patch respun, sent, and pinged again.

Comment 4 Eric Sandeen 2011-09-12 20:32:31 UTC
Ok, this did finally make it upstream.  However, it is still not in any released e2fsprogs.  Are you ok with this being closed UPSTREAM or do you really want/need it in a fedora release?

Thanks,
-Eric

commit a8d8432b584c222dc7960c15cd7b9acbc7c72352
Author: Eric Sandeen <sandeen>
Date:   Thu May 5 13:21:08 2011 -0500

    filefrag: count 0 extents properly when verbose
    
    /boot/a: 0 extents found
    
    works properly, but
    
    Filesystem type is: ef53
    Filesystem cylinder groups is approximately 61
    File size of a is 0 (0 blocks, blocksize 1024)
     ext logical physical expected length flags
    a: 1 extent found
    
    yields 1 extent when it should be 0.
    
    Fix this up by special-casing no extents returned in verbose
    mode; skip printing the header for the columns too, since there
    are no columns to print.
    
    Also, in nonverbose mode we can set fm_extent_count to 0
    so that FIEMAP will just query the extent count without gathering
    details; clarify this with a comment.
    
    Addresses-RedHat-Bugzilla: 653234
    Signed-off-by: Eric Sandeen <sandeen>
    Signed-off-by: Theodore Ts'o <tytso>

Comment 5 Pádraig Brady 2011-09-12 20:53:47 UTC
Thanks for following this up Eric.
I've marked this closed upstream, as there was no direct logic dependent on it.
It just confused me when I was testing coreutils cp.


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