Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751532AbcDTXuY (ORCPT ); Wed, 20 Apr 2016 19:50:24 -0400 Received: from ozlabs.org ([103.22.144.67]:48544 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751229AbcDTXuX (ORCPT ); Wed, 20 Apr 2016 19:50:23 -0400 Date: Thu, 21 Apr 2016 09:50:21 +1000 From: Stephen Rothwell To: Hugh Dickins Cc: Andrew Morton , "Kirill A. Shutemov" , Andrea Arcangeli , Andres Lagar-Cavilla , Yang Shi , Ning Qu , Mika Penttila , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH mmotm 3/5] huge tmpfs recovery: tweak shmem_getpage_gfp to fill team fix Message-ID: <20160421095021.422d54ed@canb.auug.org.au> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1190 Lines: 37 Hi Hugh, On Sat, 16 Apr 2016 16:33:07 -0700 (PDT) Hugh Dickins wrote: > > Please add this fix after my 27/31, your > huge-tmpfs-recovery-tweak-shmem_getpage_gfp-to-fill-team.patch > for later merging into it. Great catch by Mika Penttila, a bug which > prevented some unusual cases from being recovered into huge pages as > intended: an initially sparse head would be set PageTeam only after > this check. But the check is guarding against a racing disband, which > cannot happen before the head is published as PageTeam, plus we have > an additional reference on the head which keeps it safe throughout: > so very easily fixed. > > Reported-by: Mika Penttila > Signed-off-by: Hugh Dickins > --- > mm/shmem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -2938,7 +2938,7 @@ repeat: > page = *pagep; > lock_page(page); > head = page - (index & (HPAGE_PMD_NR-1)); > - if (!PageTeam(head)) { > + if (!PageTeam(head) && page != head) { > error = -ENOENT; > goto decused; > } Added to linux-next today. -- Cheers, Stephen Rothwell