diff -urN -X /home/cso/jnewbigin/dontdiff /usr/src/linux-2.4/fs/dquot.c ./fs/dquot.c
--- /usr/src/linux-2.4/fs/dquot.c	Wed Feb 11 15:26:54 2004
+++ ./fs/dquot.c	Sat Mar 13 19:18:24 2004
@@ -49,6 +49,8 @@
  *		Alocation units changed to bytes
  *		Jan Kara, <jack@suse.cz>, 2000
  *
+ *		BK cset 1.133
+ *
  * (C) Copyright 1994 - 1997 Marco van Wieringen 
  */
 
@@ -906,6 +908,7 @@
  *	End of IO functions
  */
 
+#if 0
 /*
  * Unhash and selectively clear the dquot structure,
  * but preserve the use count, list pointers, and
@@ -924,6 +927,7 @@
 	dquot->dq_referenced = 0;
 	memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk));
 }
+#endif
 
 /* Invalidate all dquots on the list, wait for all users. Note that this function is called
  * after quota is disabled so no new quota might be created. As we only insert to the end of
@@ -940,6 +944,7 @@
 			continue;
 		if (dquot->dq_type != type)
 			continue;
+		dquot->dq_flags |= DQ_INVAL;
 		if (dquot->dq_count)
 			/*
 			 *  Wait for any users of quota. As we have already cleared the flags in
@@ -961,6 +966,7 @@
 	struct list_head *head;
 	struct dquot *dquot;
 
+	lock_kernel();
 restart:
 	for (head = inuse_list.next; head != &inuse_list; head = head->next) {
 		dquot = list_entry(head, struct dquot, dq_inuse);
@@ -982,6 +988,7 @@
 		goto restart;
 	}
 	dqstats.syncs++;
+	unlock_kernel();
 	return 0;
 }
 
@@ -1042,12 +1051,13 @@
 	}
 #endif
 	dquot->dq_count--;
-	/* Place at end of LRU free queue */
-	put_dquot_last(dquot);
+	/* If dquot is going to be invalidated invalidate_dquots() is going to free it so */
+	if (!(dquot->dq_flags & DQ_INVAL))
+		put_dquot_last(dquot); /* Place at end of LRU free queue */
 	wake_up(&dquot->dq_wait_free);
 }
 
-struct dquot *get_empty_dquot(void)
+static struct dquot *get_empty_dquot(void)
 {
 	struct dquot *dquot;
 
@@ -1214,9 +1224,11 @@
 /* Free list of dquots - called from inode.c */
 void put_dquot_list(struct list_head *tofree_head)
 {
-	struct list_head *act_head = tofree_head->next;
+	struct list_head *act_head;
 	struct dquot *dquot;
 
+	lock_kernel();
+	act_head = tofree_head->next;
 	/* So now we have dquots on the list... Just free them */
 	while (act_head != tofree_head) {
 		dquot = list_entry(act_head, struct dquot, dq_free);
@@ -1225,6 +1237,7 @@
 		INIT_LIST_HEAD(&dquot->dq_free);
 		dqput(dquot);
 	}
+	unlock_kernel();
 }
 
 static inline void dquot_incr_inodes(struct dquot *dquot, unsigned long number)
@@ -1874,6 +1887,7 @@
 	short cnt;
 	struct quota_info *dqopt = sb_dqopt(sb);
 
+	lock_kernel();
 	if (!sb)
 		goto out;
 
@@ -1899,6 +1913,7 @@
 	}	
 	up(&dqopt->dqoff_sem);
 out:
+	unlock_kernel();
 	return 0;
 }
 
diff -urN -X /home/cso/jnewbigin/dontdiff /usr/src/linux-2.4/include/linux/quota.h ./include/linux/quota.h
--- /usr/src/linux-2.4/include/linux/quota.h	Wed Feb 11 15:27:52 2004
+++ ./include/linux/quota.h	Sat Mar 13 19:10:59 2004
@@ -220,6 +220,7 @@
 #define DQ_BLKS       0x10	/* uid/gid has been warned about blk limit */
 #define DQ_INODES     0x20	/* uid/gid has been warned about inode limit */
 #define DQ_FAKE       0x40	/* no limits only usage */
+#define DQ_INVAL      0x80	/* dquot is going to be invalidated */
 
 struct dquot {
 	struct list_head dq_hash;	/* Hash list in memory */
