I have noticed a problem with the fts(3) library or the way du(1) interacts
with it.

A 3.2TiB file gives the following output:
> du -cs /fs/file
3408720016      /fs/file
-886247279      total
> du -hcs /fs/file
3.2T    /fs/file
        total
> 

This is because while stat(2) reports blocks as a 64bit number du(1) uses
the 32bit value FTSENT.fts_number to store the result:
du.c (1.36):
269:                            p->fts_parent->fts_number +=
p->fts_statp->st_blocks;
270:            }
271:            savednumber = p->fts_parent->fts_number;
272:    }

The simplest change appears to be to make fts_number 64bit however this
changes the fts(3) abi, so I am not sure if this is acceptable.

Thoughts?

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to