Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[regression] filefrag: bad count of extents in FIBMAP mode without -v or -e

2013-10-19
2013-10-19
  • mranderson2007
    mranderson2007
    2013-10-19

    As I do not have sufficient permissions to create a bug report (is this intended?), I write this here.

    When running filefrag in FIBMAP mode (i. e. forced with -B or FIEMAP not supported) and not appending -v or -e to the command line, the printed number of extents is always 1.

    The first affected release is 1.42.7.

    bisecting led to commit 2508eaa71e8bbe93155052ded448e5e78d213715:
    filefrag: improvements to filefrag FIEMAP handling

    After a quick look at the code, this looks to me like the source of the problem:

    in misc/filefrag.c, in function filefrag_fibmap (in current HEAD of master lines 308 to 322):

    if (force_extent && ...) {
    ...
    (num_extents)++;
    } else if (verbose && ...) {
    ...
    (
    num_extents)++;
    }

    num_extents is only incremented if force_extent or if verbose. However, it is not incremented if none of the two options is activated.

     
    Last edit: mranderson2007 2013-10-19