Quota fixes

Jan Kara (jack@ucw.cz)
Mon, 25 Feb 2002 20:37:08 +0100


--V0207lvV8h4k8FAm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello Alan,

two attached patches fix bugs in quota code. First one fixes
possible deadlock/inode list corruption (Chris Mason actually
fixed this bug), second one fixes possible quotafile corruption
on heavily loaded machines. Please apply.

Honza

--V0207lvV8h4k8FAm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="dquot_deadlock.diff"

--- linux/fs/dquot.c Mon, 15 Oct 2001 03:51:05 -0400 root (linux/i/40_dquot.c 1.1.2.1.3.1.1.1 644)
+++ linux/fs/dquot.c Mon, 15 Oct 2001 14:12:57 -0400 root (linux/i/40_dquot.c 1.1.2.1.3.1.1.1 644)
@@ -1246,6 +1246,8 @@
{
if (dquot->dq_dup_ref && dquot->dq_count - dquot->dq_dup_ref <= 1)
return 1;
+ if (dquot->dq_count <= 1 && dquot->dq_flags & DQ_MOD)
+ return 1;
return 0;
}

--V0207lvV8h4k8FAm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="quota-corrupt.diff"

--- linux/fs/dquot.c Fri Feb 8 00:34:36 2002
+++ linux/fs/dquot.c Fri Feb 8 00:35:17 2002
@@ -804,9 +804,11 @@
{
uint tmp = DQTREEOFF;

- if (!dquot->dq_off) /* Even not allocated? */
- return;
down(&sb_dqopt(dquot->dq_sb)->dqio_sem);
+ if (!dquot->dq_off) { /* Even not allocated? */
+ up(&sb_dqopt(dquot->dq_sb)->dqio_sem);
+ return;
+ }
remove_tree(dquot, &tmp, 0);
up(&sb_dqopt(dquot->dq_sb)->dqio_sem);
}

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