From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:34165 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755953AbcANVC0 (ORCPT ); Thu, 14 Jan 2016 16:02:26 -0500 Date: Thu, 14 Jan 2016 21:02:23 +0000 From: Al Viro To: Tomeu Vizoso Cc: "linux-kernel@vger.kernel.org" , Linus Torvalds , Neil Brown , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 06/11] don't put symlink bodies in pagecache into highmem Message-ID: <20160114210223.GA17997@ZenIV.linux.org.uk> References: <20151209053209.GV20997@ZenIV.linux.org.uk> <1449639295-20512-6-git-send-email-viro@ZenIV.linux.org.uk> <20160114152553.GW17997@ZenIV.linux.org.uk> <20160114162333.GX17997@ZenIV.linux.org.uk> <20160114171341.GY17997@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Jan 14, 2016 at 08:15:57PM +0100, Tomeu Vizoso wrote: > On 14 January 2016 at 18:13, Al Viro wrote: > > On Thu, Jan 14, 2016 at 05:57:42PM +0100, Tomeu Vizoso wrote: > >> Here it is: > >> > >> [ 170.715356] inode: ec8c30b0, pages: 1 > >> [ 170.719014] page_address: (null) > >> > >> https://lava.collabora.co.uk/scheduler/job/127698/log_file > > > > Lovely... And that looks like the first time that inode hits > > nfs_get_link(). Ho-hum... > > > > Could you add WARN_ON(inode->i_mapping.nrpages) in inode_nohighmem() > > and see if that triggers? It really shouldn't (we hit it after iget5_locked() > > Indeed :( > > https://lava.collabora.co.uk/scheduler/job/127782/log_file OK... Unless I'm misreading that, we have * inode->i_data.flags set to GFP_USER, with no pages present in there. * at some later point nfs_get_link() is called on that inode (for the first time) and sees a page with logical offset 0 already present in there, that page being a highmem one. That would certainly suffice for the things to blow up... Let's try this: in the beginning of __add_to_page_cache_locked() add VM_BUG_ON_PAGE(PageHighMem(page) & !(mapping->flags & __GFP_HIGHMEM), page); and see if that triggers. Arrrgh. Try this: diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index ce5a218..8a05309 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1894,15 +1894,14 @@ int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) attr.ia_mode = S_IFLNK | S_IRWXUGO; attr.ia_valid = ATTR_MODE; - page = alloc_page(GFP_HIGHUSER); + page = alloc_page(GFP_USER); if (!page) return -ENOMEM; - kaddr = kmap_atomic(page); + kaddr = page_address(page); memcpy(kaddr, symname, pathlen); if (pathlen < PAGE_SIZE) memset(kaddr + pathlen, 0, PAGE_SIZE - pathlen); - kunmap_atomic(kaddr); trace_nfs_symlink_enter(dir, dentry); error = NFS_PROTO(dir)->symlink(dir, dentry, page, pathlen, &attr);