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

  • 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 && ...) {
    } else if (verbose && ...) {

    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
  • mranderson2007

    mranderson2007 - 2015-10-16

    Thanks for fixing.

    (commit [c47cd4], release 1.42.12)



    Commit: [c47cd4]

Log in to post a comment.