[PATCH] possible bug in quota format v2 support

From: Niu YaWei
Date: Thu Mar 31 2005 - 08:26:53 EST


Hi Jan,

I'm afraid that there is a bug in quota format v2 delete qentry.
(The root block shouldn't be put into free blk list even if there isn't
any entry in quota file, right?)

This one line patch may fix it.

Thanks.

- Niu

--- linux-2.6.7/fs/quota_v2.c 2005-01-21 16:47:34.000000000 +0800
+++ linux-2.6.7-quota-v2/fs/quota_v2.c 2005-03-31 21:08:30.012641840 +0800
@@ -529,7 +529,8 @@ static int remove_tree(struct dquot *dqu
int i;
ref[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(filp, dquot->dq_type, buf, *blk);
*blk = 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/