[9fans] Fossil thinks my free space is a wee bit more than it is - Plan9

This is a discussion on [9fans] Fossil thinks my free space is a wee bit more than it is - Plan9 ; While untarring a big-ish file to a small-ish hard drive, I was running df on my fossil console to see if I was going to run out of space. The output from these successive runs is... not correct: prompt: fsys ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: [9fans] Fossil thinks my free space is a wee bit more than it is

  1. [9fans] Fossil thinks my free space is a wee bit more than it is

    While untarring a big-ish file to a small-ish hard drive, I was
    running df on my fossil console to see if I was going to run out of
    space. The output from these successive runs is... not correct:

    prompt: fsys main df
    main: 1,644,601,344 used + 2,588,672 free = 1,647,190,016 (99% used)
    prompt: fsys main df
    main: 1,652,891,648 used + 35,184,366,387,200 free = 1,647,190,016 (100% used)
    prompt: fsys main df
    main: 1,666,473,984 used + 35,184,352,804,864 free = 1,647,190,016 (101% used)
    prompt: fsys main df
    main: 1,693,908,992 used + 35,184,325,369,856 free = 1,647,190,016 (102% used)

    Overdraft protection? For reference:

    :; ls -l /dev/sdC0/fossil
    --rw-r----- S 0 a a 1650169856 Aug 1 22:57 /dev/sdC0/fossil

    Things seem to be operating more-or-less normally so this isn't a huge
    issue, but it's clearly a reporting bug.

    Anthony

  2. Re: [9fans] Fossil thinks my free space is a wee bit more than it is

    > prompt: fsys main df
    > main: 1,644,601,344 used + 2,588,672 free = 1,647,190,016 (99% used)
    > prompt: fsys main df
    > main: 1,652,891,648 used + 35,184,366,387,200 free = 1,647,190,016 (100% used)
    > prompt: fsys main df
    > main: 1,666,473,984 used + 35,184,352,804,864 free = 1,647,190,016 (101% used)
    > prompt: fsys main df
    > main: 1,693,908,992 used + 35,184,325,369,856 free = 1,647,190,016 (102% used)
    >
    > Overdraft protection? For reference:
    >
    > :; ls -l /dev/sdC0/fossil
    > --rw-r----- S 0 a a 1650169856 Aug 1 22:57 /dev/sdC0/fossil
    >
    > Things seem to be operating more-or-less normally so this isn't a huge
    > issue, but it's clearly a reporting bug.
    >
    > Anthony


    let's see. fossil uses bsize=8*1024. 35184366387200/8192 = 4294966600.
    that looks like a small negative [sic] u32int to me.

    i see where fl->used is incremented, but i don't see where it's decremented.
    maybe that's correct, but it looks fishy.

    - erik

  3. Re: [9fans] Fossil thinks my free space is a wee bit more than it is

    The fix should be to edit the bottom of
    /sys/src/cmd/fossil/cache.c:/^doRemoveLink
    changing

    l.epochClose = p->epoch;
    blockSetLabel(b, &l, 0);

    to

    l.epochClose = p->epoch;
    if(l.epochClose == l.epoch){
    vtLock(c->fl->lk);
    if(l.epoch == c->fl->epochlow)
    c->fl->nused--;
    blockSetLabel(b, &l, 0);
    vtUnlock(c->fl->lk);
    }else
    blockSetLabel(b, &l, 0);

    Untested.

    Treating l.epoch == l.epochClose as meaning the block is free
    is an optimization that allows fossil to reclaim space allocated
    and then discarded in the same snapshot. The nused tracking
    code was not changed when the optimization got added,
    causing the misreported use numbers.

    Also, you can delete u32int nfree; from struct FreeList.
    It is never accessed.

    Russ


+ Reply to Thread