From: Nick Piggin <npiggin@suse.de>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch 2/2] fs: symlink write_begin allocation context fix
Date: Thu, 27 Nov 2008 12:14:29 +0100 [thread overview]
Message-ID: <20081127111429.GL28285@wotan.suse.de> (raw)
In-Reply-To: <20081127200014.3CF6.KOSAKI.MOTOHIRO@jp.fujitsu.com>
On Thu, Nov 27, 2008 at 08:02:32PM +0900, KOSAKI Motohiro wrote:
> > -int __page_symlink(struct inode *inode, const char *symname, int len,
> > - gfp_t gfp_mask)
> > +/*
> > + * The nofs argument instructs pagecache_write_begin to pass AOP_FLAG_NOFS
> > + */
> > +int __page_symlink(struct inode *inode, const char *symname, int len, int nofs)
> > {
> > struct address_space *mapping = inode->i_mapping;
> > struct page *page;
> > void *fsdata;
> > int err;
> > char *kaddr;
> > + unsigned int flags = AOP_FLAG_UNINTERRUPTIBLE;
> > + if (nofs)
> > + flags |= AOP_FLAG_NOFS;
> >
> > retry:
> > err = pagecache_write_begin(NULL, mapping, 0, len-1,
> > - AOP_FLAG_UNINTERRUPTIBLE, &page, &fsdata);
> > + flags, &page, &fsdata);
> > if (err)
> > goto fail;
> >
> > @@ -2820,8 +2825,7 @@ fail:
> >
> > int page_symlink(struct inode *inode, const char *symname, int len)
> > {
> > - return __page_symlink(inode, symname, len,
> > - mapping_gfp_mask(inode->i_mapping));
> > + return __page_symlink(inode, symname, len, 0);
> > }
>
> your patch always pass 0 into __page_symlink().
> therefore it doesn't change any behavior.
>
> right?
Ah, you're right I think. I misread the code: most filesystems can
tolerate GFP_FS here, and its just ext3/4 and a few others which require
nofs here.
Annoyingly, some filesystems put GFP_NOFS into their mapping_gfp_mask.
This may or may not get honoured depending on what core functions get
used (radix tree allocations shouldn't and don't allocate pages
with the mapping_gfp_mask).
Anyway, I'll set nofs=1 in the case that mapping_gfp_mask has __GFP_FS
cleared, in an attempt to minimise the chance of breakage...
Good spotting, thanks.
next prev parent reply other threads:[~2008-11-27 11:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 9:34 [patch 1/2] mm: pagecache allocation gfp fixes Nick Piggin
2008-11-27 9:35 ` [patch 2/2] fs: symlink write_begin allocation context fix Nick Piggin
2008-11-27 11:02 ` KOSAKI Motohiro
2008-11-27 11:14 ` Nick Piggin [this message]
2008-11-28 14:37 ` Nick Piggin
2008-11-29 6:35 ` KOSAKI Motohiro
2008-11-27 9:52 ` [patch 1/2] mm: pagecache allocation gfp fixes Pekka Enberg
2008-11-27 10:01 ` Nick Piggin
2008-11-27 10:18 ` Nick Piggin
2008-11-27 10:28 ` Pekka Enberg
2008-11-27 10:40 ` KOSAKI Motohiro
2008-11-27 18:14 ` Hugh Dickins
2008-11-28 12:04 ` Nick Piggin
2008-12-01 1:18 ` Hugh Dickins
2008-12-01 1:50 ` KAMEZAWA Hiroyuki
2008-12-01 7:39 ` KAMEZAWA Hiroyuki
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=20081127111429.GL28285@wotan.suse.de \
--to=npiggin@suse.de \
--cc=akpm@linux-foundation.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).