mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Jan Kara <jack@ucw.cz>
Cc: linux-kernel@vger.kernel.org, lukasz@wsisiz.edu.pl,
	j.borsboom@erasmusmc.nl, crosser@average.org, torvalds@osdl.org
Subject: Re: [PATCH] Quota fix 2
Date: Sun, 16 May 2004 00:04:01 -0700	[thread overview]
Message-ID: <20040516000401.506d8456.akpm@osdl.org> (raw)
In-Reply-To: <20040515192824.GB21471@atrey.karlin.mff.cuni.cz>

Jan Kara <jack@ucw.cz> wrote:
>
>   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.

It makes sense.

> I hope I got the GFP mask setting right..

nope!  Here's a fix against your patch.




---

 25-akpm/fs/dquot.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)

diff -puN fs/dquot.c~quota-recursion-fix-fix fs/dquot.c
--- 25/fs/dquot.c~quota-recursion-fix-fix	2004-05-15 23:58:31.365278768 -0700
+++ 25-akpm/fs/dquot.c	2004-05-16 00:02:52.667554784 -0700
@@ -1372,7 +1372,16 @@ static int vfs_quota_on_file(struct file
 	 * 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);
+
+	/*
+	 * We write to quota files deep within filesystem code.  We don't want
+	 * the VFS to reenter filesystem code when it tries to allocate a
+	 * pagecache page for the quota file write.  So clear __GFP_FS in
+	 * the quota file's allocation flags.
+	 */
+	mapping_set_gfp_mask(inode->i_mapping,
+		mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
+
 	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
 		to_drop[cnt] = inode->i_dquot[cnt];
 		inode->i_dquot[cnt] = NODQUOT;

_


  reply	other threads:[~2004-05-16  7:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-15 19:28 Jan Kara
2004-05-16  7:04 ` Andrew Morton [this message]
2004-05-17  9:13   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040516000401.506d8456.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=crosser@average.org \
    --cc=j.borsboom@erasmusmc.nl \
    --cc=jack@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz@wsisiz.edu.pl \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®