summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2005-03-31 13:49:41 +0000
committerjkar8572 <jkar8572>2005-03-31 13:49:41 +0000
commit73b8a3065ecc0ca69b507538406953da1ca3df72 (patch)
treedee20a1e445ef9371554b539c6185402be512c86
parent48e25f93f40a71786df4598fc9ca038779cda979 (diff)
downloadlinuxquota-73b8a3065ecc0ca69b507538406953da1ca3df72.tar.gz
Handle better when quota file in v2 format would become empty (Niu YaWei)
-rw-r--r--Changelog1
-rw-r--r--quotaio_v2.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/Changelog b/Changelog
index b024fd0..3c2df3e 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,5 @@
Changes in quota-tools from 3.12 to 3.13
+* handle better when quota file should become empty (Niu YaWei)
* minor manpage and help-text fixes (Jan Kara)
* fixed quotacheck(8) to check each block only once (Jan Kara)
* fixed quotacheck(8) messages about corrupted blocks (Jan Kara)
diff --git a/quotaio_v2.c b/quotaio_v2.c
index 5176435..d947839 100644
--- a/quotaio_v2.c
+++ b/quotaio_v2.c
@@ -545,7 +545,8 @@ static void remove_tree(struct quota_handle *h, struct dquot *dquot, uint * blk,
ref[V2_GETIDINDEX(dquot->dq_id, depth)] = __cpu_to_le32(0);
for (i = 0; i < V2_DQBLKSIZE && !buf[i]; i++); /* Block got empty? */
- if (i == V2_DQBLKSIZE) {
+ /* Don't put the root block into the free block list */
+ if (i == V2_DQBLKSIZE && *blk != V2_DQTREEOFF) {
put_free_dqblk(h, buf, *blk);
*blk = 0;
}