Re: [patch 68/85] fs: symlink write_begin allocation context fix

From: Greg KH
Date: Fri Jan 16 2009 - 18:18:45 EST


On Fri, Jan 16, 2009 at 03:53:10AM +0100, Nick Piggin wrote:
> On Thu, Jan 15, 2009 at 02:31:17PM -0800, Greg KH wrote:
> > On Thu, Jan 15, 2009 at 02:01:36PM -0800, Greg KH wrote:
> > > 2.6.27-stable review patch. If anyone has any objections, please let us know.
> >
> > Hm, I think I got the backport of this patch wrong in two place:
> >
> > > --- a/mm/filemap.c
> > > +++ b/mm/filemap.c
> > > @@ -2033,7 +2033,7 @@ int pagecache_write_begin(struct file *f
> > > struct inode *inode = mapping->host;
> > > struct page *page;
> > > again:
> > > - page = __grab_cache_page(mapping, index);
> > > + page = grab_cache_page_write_begin(mapping, index, flags);
> >
> > I think this shouldn't be "flags", but 0, right?
>
> I think flags is right. That way, a caller of pagecache_write_begin (eg. page_symlink)
> can instruct it with AOP_FLAG_NOFS to prevent grab_cache_page from doing a GFP_KERNEL
> allocation.

Ok, I'll leave that one.

> > > @@ -2263,7 +2268,7 @@ static ssize_t generic_perform_write_2co
> > > break;
> > > }
> > >
> > > - page = __grab_cache_page(mapping, index);
> > > + page = grab_cache_page_write_begin(mapping, index, GFP_KERNEL);
> >
> > And this one? Is GFP_KERNEL ok, or 0?
> >
> > Nick, your thoughts?
>
> This should be 0. grab_cache_page_write_begin takes write_begin aop flags rather
> than regular gfp flags (it's a bit confusing, sorry :P). 0 ~= GFP_KERNEL (wheras
> AOP_FLAG_NOFS ~= GFP_NOFS). So you have the right idea ;)

I'll go fix this up and release a -rc2 with the fix in it.

thanks,

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