Re: Quota bug with preallocated blocks in ext2

Theodore Y. Ts'o (tytso@MIT.EDU)
Sun, 1 Mar 1998 20:57:45 -0500


From: Chris Rankin <rankinc@bellsouth.net>
Date: Sat, 28 Feb 1998 22:17:22 -0500

The quota problem arises because pre-allocated blocks are included in
each user / group's quota, although they are not included in the inode's
block count until they are actually committed. This means that the block
usage as reported by the quota system will always exceed the block usage
as determined by programs such as quotacheck, which scan the allocated
inodes using APIs such as stat() and lstat(). (Corollary: there is a
huge bug in quotacheck).

Is this really a problem? Blocks are only pre-allocated while the file
is open. As soon as the file is closed, the blocks are released to the
free block pool. OK, so the reported quota in use by the user is
sometimes a little bit high; does this really matter? It should be
correct if the user isn't currently writing any files. The fact that
it's different from quotacheck isn't all that important, since
quotacheck should only be run on a quiscient filesystem anyway;
otherwise its results can't be at all guaranteed anyway.

Now, if the quota code *isn't* adjusting the user's quota to take into
account the pre-allocated blocks getting released to the free block pool
when rhe pre-allocated blocks are discarded, then that's a real bug in
the ext2 quota code. A quick check of the 2.1 ext2 code reveals that it
appears to be doing the right thing, though.

- Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu