Quota broken in 2.1.61 - patch included

James Box (jmbox@jumper.mcc.ac.uk)
Sat, 1 Nov 1997 19:49:20 +0000 (GMT)


In 2.1.60, quotaon -avug failed with a kernel oops during startup.
2.1.61 didn't fix it so I decided to investigate.

I tracked the problem down to fs/dquot.c, where the read/write file
operation calls hadn't been converted to the new argument lists.
I'm not 100% sure I got the arguments right, so someone might want
to check it first, but it fixed quota for me.

Here's the patch:

--- fs/dquot.c.orig Sat Sep 20 14:17:12 1997
+++ fs/dquot.c Sat Nov 1 02:45:10 1997
@@ -240,8 +240,8 @@
fs = get_fs();
set_fs(KERNEL_DS);

- if (filp->f_op->write(filp->f_dentry->d_inode, filp,
- (char *)&dquot->dq_dqb, sizeof(struct dqblk)) == sizeof(struct dqblk))
+ if (filp->f_op->write(filp, (char *)&dquot->dq_dqb,
+ sizeof(struct dqblk), &filp->f_pos) == sizeof(struct dqblk))
dquot->dq_flags &= ~DQ_MOD;

up(&dquot->dq_mnt->mnt_sem);
@@ -271,7 +271,7 @@
filp->f_pos = dqoff(dquot->dq_id);
fs = get_fs();
set_fs(KERNEL_DS);
- filp->f_op->read(filp->f_dentry->d_inode, filp, (char *)&dquot->dq_dqb, sizeof(struct dqblk));
+ filp->f_op->read(filp, (char *)&dquot->dq_dqb, sizeof(struct dqblk), &filp->f_pos);
up(&dquot->dq_mnt->mnt_sem);
set_fs(fs);
if (dquot->dq_bhardlimit == 0 && dquot->dq_bsoftlimit == 0 &&

James

-- 
James M. Box                            Email: jmbox@lettuce.demon.co.uk
Technical Support Manager
Barrs Court Computer Systems, Aldermoor Way, Longwell Green, Bristol, UK