Re: Quota bug in 2.0.3x?

Andrea Arcangeli (arcangeli@mbox.queen.it)
Fri, 17 Jul 1998 23:44:25 +0200 (CEST)


On Mon, 6 Jul 1998, Andrea Dell'Amico wrote:

>> fs = get_fs();
>> set_fs(KERNEL_DS);
>> - if (filp->f_op->write(filp->f_inode, filp,
>> - (char *)&dquot->dq_dqb, sizeof(struct dqblk)) == sizeof(struct
>> dqblk))
>> + /*
>> + * Here we have the superblock locked by ext2_free_inode(), but
>> + * to run without deadlock in ext2_alloc_block() we need the
>> superblock
>> + * unlocked so I try to unlock it here before the write(),
>> + * _hoping_ that it will not cause fs corruption ;-).
>> + */
>> + sb = filp->f_inode->i_sb;
>> + if ((old_super_lock = sb->s_lock))
>> + unlock_super(sb);
>> + write_retval = filp->f_op->write(filp->f_inode, filp,
>> + (char *)&dquot->dq_dqb,
>> + sizeof(struct dqblk));
>> + if (old_super_lock)
>> + lock_super(sb);
>> + if (write_retval == sizeof(struct dqblk))
>> dquot->dq_flags &= ~DQ_MOD;
>> up(&dquot->dq_mnt->mnt_sem);
>> set_fs(fs);
>>
>
>Ok, I tried it for a while doing all the tests that produced the
>malfunction on the unpatched kernel and something more. No problems at
>all, and the file system isn't trashed.

This patch isn' t been applyed to 2.0.35, but I read in the .35
description in Alan' s website that a dquota deadlock is been fixed in
.35.

Is that a more right way to fix the problem?

Andrea, could you check that 2.0.35 doesn' t deadlock as 2.0.34 does for
you without my patch applyed? (I use quota too in one server so I' d like
to be _sure_ to not deadlock ;-).

Andrea[s] Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html