Re: 2.0.31-pre9: "noise after df"

James Mastros (root@jennifer-unix.dyn.ml.org)
Tue, 16 Sep 1997 22:15:41 -0400 (EDT)


On Mon, 15 Sep 1997, Pavel Machek wrote:
>
> Hmm. Recreated in 2.1.55, df sounds like sync... And looks like sync,
> too (on blinkenlights)... And guess what:
>
> And it is because df _calls_ sync!
>
> write(1, "Filesystem 1024-blocks "..., 67Filesystem
> 1024-blocks Used Available Capacity Mounted on
> ) = 67
> sync() = 0
> statfs("/", {f_type=EXT2_SUPER_MAGIC, f_bsize=1024, f_blocks=491660,
> f_bfree=21860, f_files=127472, f_ffree=89438, f_namelen=255}}) = 0
> write(1, "/dev/hda4 491660 46"..., 58/dev/hda4
> 491660 469800 16780 97%
>
> So "bug" is in df (or is sync required before df-ing?).
> Pavel

More likely, a workaround for a bug in filesystem support in some popular
unix. (statfs() returning the metadata for only that portion that has been
written to disk, rather then computing it with the cached data taken into
account.) So df syncs (you can never sync to often) just to make shure.

-=- James Mastros