[PATCH] Fix for old quota format
From: Jan Kara
Date: Wed Jun 02 2004 - 08:01:50 EST
Hello!
Attached two-liner fixes 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).
Please apply.
Honza
diff -ruX /home/jack/.kerndiffexclude linux-2.6.7-rc2-5-credfix/fs/quota_v1.c linux-2.6.7-rc2-6-v1emptyfix/fs/quota_v1.c
--- linux-2.6.7-rc2-5-credfix/fs/quota_v1.c 2004-05-13 21:00:27.000000000 +0200
+++ linux-2.6.7-rc2-6-v1emptyfix/fs/quota_v1.c 2004-05-31 19:15:34.000000000 +0200
@@ -52,6 +52,8 @@
/* 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);