Messages in this thread | | | Date | Wed, 15 Mar 2000 00:35:53 -0800 (PST) | From | Tigran Aivazian <> | Subject | Re: df output changed between 2.3.49 and 2.3.51: why? bug? |
| |
Hi Lars,
> > just use 2.3.52 when it is out. Look for the phrase "/* Darn GNU df... */" > > in pre-patch-2.3.52-3 to understand the reason. > > I fail to see the point. > > man statfs says -1 is correct. What does the spec say?
For the spec, there is no such thing as statfs(2), but there is statvfs(2) and it (SuS v2) says:
It is unspecified whether all members of the statvfs structure have meaningful values on all file systems.
So, if the field is not meaningful it can be filled with any garbage you like and assume that the caller will not look at the garbage since she knows it is meaningless for the given filesystem.
> I don't _care_ what GNU df thinks - this is a fairly minor change, and if we > don't manage to stick to the docs here because a userland tool gets confused, > how can we ever expect to get a bigger fix done, if it "breaks" userland?
Well, I do care what standard (GNU) df(1) thinks. Look at fileutils-4.0m/src/df.c and read the comment around show_all_entries() function:
/* Show all mounted filesystems, except perhaps those that are of an unselected type or are empty. */
and then notice this code in show_dev() to confirm the comment:
if (fsu.fsu_blocks == 0 && !show_all_fs && !show_listed_fs) return;
So, the Linux tradition (nothing to do with standards) was to set undefined fields (sizes notably) to 0 and df(1) agreed to skip them unless -a was specified and changing 0 -> -1 broke that tradition and therefore df(1) output. I just noticed that df --help says so as well, so there was no need to read the code :)
# \df --help | grep \\-a -a, --all include filesystems having 0 blocks
Now, do you see the point? As for the manpage, well, I cc:Andries so he could either update it to say "unspecified fields are set to 0" (probably a bad thing to do) or, even better, we can all agree as gentlemen that for filesystems like proc, devfs, devpts the numbers of blocks are not "unspecified" but rather very well specified and must be 0.
Regards, Tigran.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |