]> git.hungrycats.org Git - linux/commitdiff
[PATCH] quota: fix for old quota format
authorAndrew Morton <akpm@osdl.org>
Thu, 3 Jun 2004 01:03:52 +0000 (18:03 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 3 Jun 2004 01:03:52 +0000 (18:03 -0700)
From: Jan Kara <jack@ucw.cz>

Fix a problem in the old quota format when we tried to read quota
information after the end of quota file (that is correct as it might a user
with sufficiently large UID which has no limits or usage).

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/quota_v1.c

index 2ffb492c83ac97545fc2244a6882937e1516e595..7c7de9102c39c7a301e7a3cfa11b8beec9e6307a 100644 (file)
@@ -52,6 +52,8 @@ static int v1_read_dqblk(struct dquot *dquot)
 
        /* Now we are sure filp is valid */
        offset = v1_dqoff(dquot->dq_id);
+       /* Set structure to 0s in case read fails/is after end of file */
+       memset(&dqblk, 0, sizeof(struct v1_disk_dqblk));
        fs = get_fs();
        set_fs(KERNEL_DS);
        filp->f_op->read(filp, (char *)&dqblk, sizeof(struct v1_disk_dqblk), &offset);