mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Quota fix 2
@ 2004-05-15 19:28 Jan Kara
  2004-05-16  7:04 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2004-05-15 19:28 UTC (permalink / raw)
  To: akpm
  Cc: linux-kernel, Lukasz Trabinski, Jerome Borsboom, Eugene Crosser,
	torvalds

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

  Hello,

  another fix for quota code - it fixes the problem with recursion into
filesystem when inode of quota file needs a page + some other allocation
problems. I hope I got the GFP mask setting right.. The patch is against
2.6.6 with the patch you sent to Linus & my previous quota patch. Please
apply.

								Honza


[-- Attachment #2: quota-2.6.6-3-slabfix.diff --]
[-- Type: text/plain, Size: 1761 bytes --]

diff -ruX /home/jack/.kerndiffexclude linux-2.6.6-2-releasefix/fs/dquot.c linux-2.6.6-3-slabfix/fs/dquot.c
--- linux-2.6.6-2-releasefix/fs/dquot.c	2004-05-13 21:05:02.000000000 +0200
+++ linux-2.6.6-3-slabfix/fs/dquot.c	2004-05-14 15:19:38.000000000 +0200
@@ -75,6 +75,7 @@
 #include <linux/proc_fs.h>
 #include <linux/security.h>
 #include <linux/kmod.h>
+#include <linux/pagemap.h>
 
 #include <asm/uaccess.h>
 
@@ -547,7 +548,7 @@
 {
 	struct dquot *dquot;
 
-	dquot = kmem_cache_alloc(dquot_cachep, SLAB_KERNEL);
+	dquot = kmem_cache_alloc(dquot_cachep, SLAB_NOFS);
 	if(!dquot)
 		return NODQUOT;
 
@@ -1366,9 +1367,12 @@
 	error = -EINVAL;
 	if (!fmt->qf_ops->check_quota_file(sb, type))
 		goto out_file_init;
-	/* We don't want quota and atime on quota files (deadlocks possible) */
+	/* We don't want quota and atime on quota files (deadlocks possible)
+	 * We also need to set GFP mask differently because we cannot recurse
+	 * into filesystem when allocating page for quota inode */
 	down_write(&dqopt->dqptr_sem);
 	inode->i_flags |= S_NOQUOTA | S_NOATIME;
+	clear_bit(ffs(__GFP_FS), &inode->i_mapping->flags);
 	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
 		to_drop[cnt] = inode->i_dquot[cnt];
 		inode->i_dquot[cnt] = NODQUOT;
diff -ruX /home/jack/.kerndiffexclude linux-2.6.6-2-releasefix/fs/quota_v2.c linux-2.6.6-3-slabfix/fs/quota_v2.c
--- linux-2.6.6-2-releasefix/fs/quota_v2.c	2004-05-13 21:00:27.000000000 +0200
+++ linux-2.6.6-3-slabfix/fs/quota_v2.c	2004-05-14 15:14:28.000000000 +0200
@@ -135,7 +135,7 @@
 
 static dqbuf_t getdqbuf(void)
 {
-	dqbuf_t buf = kmalloc(V2_DQBLKSIZE, GFP_KERNEL);
+	dqbuf_t buf = kmalloc(V2_DQBLKSIZE, GFP_NOFS);
 	if (!buf)
 		printk(KERN_WARNING "VFS: Not enough memory for quota buffers.\n");
 	return buf;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-05-17  9:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-15 19:28 [PATCH] Quota fix 2 Jan Kara
2004-05-16  7:04 ` Andrew Morton
2004-05-17  9:13   ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®