Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp154831ybl; Mon, 12 Aug 2019 13:34:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVzf1Svf+AxoDh5gtWoXyjLdHFtvdMMtfpKLVvTdE5OLazBRhymA2ZYLI9pVVqrUQaWBYD X-Received: by 2002:a62:2aca:: with SMTP id q193mr38011070pfq.209.1565642062541; Mon, 12 Aug 2019 13:34:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565642062; cv=none; d=google.com; s=arc-20160816; b=rd51/FXGk5U3CGar4AnkWryKW2HjwKoR18UMyVile7Isplx63TBxYfc/osJkZfR/Fy H/B610RY3x1BmS6gnNebTGZYbiFYngmHo9dWNn9LwwdFjpYWfydaKnXSvB8HJtOI3pSn JwC6qzeSBCO6pXwOz0xB3/538VdNSwVhjuXfQM6LBvI47jxMv0oADUr1vaNJmrEwnOJ3 dc5PN1xB5wKyXNBrXwCg9q4XcRpZgA+Y8o0pRb8EqgQuJmr+GziNqXeutoWH0oZ/0WV4 QTNWhXb+UNUrYOPk3t/KwRlvFiec2q26ltBMQw2s/uPH+zfsTj+5If2BJQnyt5HmHJX4 Q+/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=opuTeOP019YiHjS7zgVGx1N/ZtI2m573pQ8Fm6DPedA=; b=Uv37ZDWE/s5o0ew7k2fYTiGW+P/qjnvjRvXjG1FW5U2pkdY77m1sX1xxtBZRa7iNEV q2mj6sDTYtteNXLw+aISqDcb4Fze8qSKaKjjK/rBWg81g+52ZukkJpN9VMXzEU0k+lTX HRaiL/SpoZUWbRpHkSWHy3Z8a4kJW0BiFy74CwEjfKZ8y6zxFhze263VDDs+1S8AMDnG I0YUwVus8dNwDPVXkSbhsue0wP6bE0vMyTDq7RZHFgW7Llr/l4UYYNoZF0YM/bjJzjh0 uoOZ8xPGhpwe3I3/8jj7snkeWYj2Pn3+oNNxvjET1iDNA1/uEp3hN7lnxcchHl6ggNaS ILTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=Ns5tnFaX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w13si13758741ply.218.2019.08.12.13.34.05; Mon, 12 Aug 2019 13:34:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=Ns5tnFaX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726595AbfHLUdI (ORCPT + 99 others); Mon, 12 Aug 2019 16:33:08 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36440 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbfHLUdH (ORCPT ); Mon, 12 Aug 2019 16:33:07 -0400 Received: by mail-pg1-f195.google.com with SMTP id l21so50057719pgm.3 for ; Mon, 12 Aug 2019 13:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=opuTeOP019YiHjS7zgVGx1N/ZtI2m573pQ8Fm6DPedA=; b=Ns5tnFaXWDviA+GNTixFkO7AFl1W+l/Ald/kQO5BWa44a6ukvr1eWIfWjaWVDYUYDj hiAQT2HpufQzPthDGeB765CF3V6cCc9ECB9Nb9FumVOdvKyCv603isBx/5MPS6iHlrNj YgxsfNStteKFyfoyRgVQ7FztMMbz+A+7H9xCy4FP4N6hIP3FexB/hSxdWfnYZ5e8qxoO n8ijIrIRl4bVRGBQMRhePCuyMmbw7FhP1X3hyIp9VFPC+iRXtGEIKjnn3rnFwdAycubP 1wpdkQhN3+kVMZT8ywoPlKyHLiAEMXVoKcD7/Lr1NHmQ8oLt8qXpYTHauzLeviIHKc2M tWfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=opuTeOP019YiHjS7zgVGx1N/ZtI2m573pQ8Fm6DPedA=; b=ojsyqzKzlAHRzJ6uIBrtzUBvoymi/pFYYpLMlfkNIz2u961Ce4Ve5L/d3u45NvoXe4 ZbxCfvOX3gBVgEmfTGwcmwItUaPCA8YVTg7jnzerv4K1hp+HqLtXtGm+UXKWsg8sR5jb hxje6e+4766VoFSQpT0gZ5+0L3sdqao2sy8M88H2qj/V/sb1U+8jlUk12gWU29/DCTRN en4MxAI48rQdDIFQO3DktX4wjToTz6gPaj43x4m0Y3tANKNa08+ne5pSTgiyjkRMsBdZ VThqRj9onyYvVvMI8U9Uar6YgYj/bpo0FoRNtHbyoHR5NjjhUVYjzulUm/5iQqFUe+8u joWg== X-Gm-Message-State: APjAAAXvhad9Ljo24LBQ2HbgZhOgsBOKlCazaLHSA5+mWp8GvDwtLklX lMUGhdqeGGF1k/vinLjbsAIzqw== X-Received: by 2002:a17:90a:d793:: with SMTP id z19mr1014808pju.36.1565641986978; Mon, 12 Aug 2019 13:33:06 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::2:f08]) by smtp.gmail.com with ESMTPSA id b6sm93774090pgq.26.2019.08.12.13.33.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 13:33:06 -0700 (PDT) Date: Mon, 12 Aug 2019 16:33:04 -0400 From: Johannes Weiner To: Song Liu Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, matthew.wilcox@oracle.com, kirill.shutemov@linux.intel.com, kernel-team@fb.com, william.kucharski@oracle.com, akpm@linux-foundation.org, hdanton@sina.com Subject: Re: [PATCH v10 2/7] filemap: check compound_head(page)->mapping in pagecache_get_page() Message-ID: <20190812203304.GA15498@cmpxchg.org> References: <20190801184244.3169074-1-songliubraving@fb.com> <20190801184244.3169074-3-songliubraving@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190801184244.3169074-3-songliubraving@fb.com> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 01, 2019 at 11:42:39AM -0700, Song Liu wrote: > Similar to previous patch, pagecache_get_page() avoids race condition > with truncate by checking page->mapping == mapping. This does not work > for compound pages. This patch let it check compound_head(page)->mapping > instead. > > Suggested-by: Johannes Weiner > Signed-off-by: Song Liu Acked-by: Johannes Weiner