Received: by 10.213.65.68 with SMTP id h4csp2634837imn; Mon, 9 Apr 2018 06:45:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4957G0c1qSBBHwP8p4Ar3VTm8/XPsijOVZAEMO4mbedODNTh7LfWlYic9froqKfopXrPj73 X-Received: by 10.99.116.67 with SMTP id e3mr14975005pgn.369.1523281505998; Mon, 09 Apr 2018 06:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523281505; cv=none; d=google.com; s=arc-20160816; b=Qs06bB2SlhjyVJoW+ERo8nQG9Gg/k+2O9UnYhC1EZkeWqcWQ+xpQLGhd6WifwEhUxy yt3Hu1lW2LSprabEckwPOuY/tQCany3bW8uIWxlL+HdHeqqUoY9ddjVcCW3MyQikbxGp SDtsDL8BxSv9I38tziVVzoRRGPayG85+2E4iIYuEddDcku90YVbDHtkOchX6AiLO5Pfx 64szAexDyaQGxLoPtCx/8hyDFQgOJEADTI64zHxsww42RPNfbTK1e9l8WXSHARPU1FSX pkmEMOYPwyTj3SRvXMdW7Q63r1CSe99lyXcyS85dZv+fdZyaLqYtgmqmujOLcMTjWZRr k5Pg== 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:arc-authentication-results; bh=HsL2IBYDhbqskgEkL3d4HLhSoNbVPFdzomnVLnsPkJc=; b=zCDLYHOv9m8FL+vYmnoLqPogE5X7rDYPCdfDYfC6pzL9w8T/2dClw8kNgpan3i++tQ YjLnVmIDVq8HXgqmj50bjQlwUnP9NKL2as4DM6KgdsIGwe+zNbWw6lEFHTsByRu7WsJG YheI5FQDxWsxU0Y9Lj90315QL9OLcjeyESdSX4OMoOxVBSjMu7omWCJ8QiexW3CVKb1B /LxGIoBp6GVVr/qANuWAILPDKiFjNNcXR3t89jV2qPsvozxJknQaHO6D/FFhFs4Y7ETb R37TjB28WE/jnYOCuxEQTKQRGr59QIMfsoqXCYj+1uwttSY/6vTYozwlMpACK1txCG1V HUXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=h/wDyPn0; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d87si274210pfj.348.2018.04.09.06.44.28; Mon, 09 Apr 2018 06:45:05 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=h/wDyPn0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751856AbeDINlV (ORCPT + 99 others); Mon, 9 Apr 2018 09:41:21 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:33376 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbeDINlT (ORCPT ); Mon, 9 Apr 2018 09:41:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HsL2IBYDhbqskgEkL3d4HLhSoNbVPFdzomnVLnsPkJc=; b=h/wDyPn07Pl1HRiluC11JezfW mG0QbLtxhsUc2vyyjuq26O69M2jbdnO46SIA8L4Z+SnPcjpUHMnAioGeb0SMUwUKlHT+m/ngjIwj9 BaIDx5WFktO+BihF7n67/OpoHYGkXckL6/J60GGZTjhpRu+YZSt8uiFN6d9maSyNV2h2UljVJFhge L+cEDY7lJFRdJ8znEdkxg92m2WoMF1AY8hiYc75BKV87lRmxu1WoriYomqyUMnpMJ1RvJ0nDaLroN FWp9AmOBTsACBa4tTg6odJfwzN6V87OiPPKdtgWiEiyD2evc26zKnnUzT4gtHqDxufLlrj1t0ntj6 zI81AKk0Q==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f5X2o-0005m9-Fu; Mon, 09 Apr 2018 13:41:14 +0000 Date: Mon, 9 Apr 2018 06:41:14 -0700 From: Matthew Wilcox To: Michal Hocko Cc: Chao Yu , Minchan Kim , Jaegeuk Kim , Christopher Lameter , Andrew Morton , linux-mm , LKML , Johannes Weiner , Jan Kara , Chris Fries , linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] mm: workingset: fix NULL ptr dereference Message-ID: <20180409134114.GA30963@bombadil.infradead.org> References: <20180409015815.235943-1-minchan@kernel.org> <20180409024925.GA21889@bombadil.infradead.org> <20180409030930.GA214930@rodete-desktop-imager.corp.google.com> <20180409111403.GA31652@bombadil.infradead.org> <20180409112514.GA195937@rodete-laptop-imager.corp.google.com> <7706245c-2661-f28b-f7f9-8f11e1ae932b@huawei.com> <20180409124852.GE21835@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180409124852.GE21835@dhcp22.suse.cz> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 09, 2018 at 02:48:52PM +0200, Michal Hocko wrote: > On Mon 09-04-18 20:25:06, Chao Yu wrote: > [...] > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > > index c85cccc2e800..cc63f8c448f0 100644 > > --- a/fs/f2fs/inode.c > > +++ b/fs/f2fs/inode.c > > @@ -339,10 +339,10 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long ino) > > make_now: > > if (ino == F2FS_NODE_INO(sbi)) { > > inode->i_mapping->a_ops = &f2fs_node_aops; > > - mapping_set_gfp_mask(inode->i_mapping, GFP_F2FS_ZERO); > > + mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); > > An unrelated question. Why do you make all allocations for the mapping > NOFS automatically? What kind of reclaim recursion problems are you > trying to prevent? It's worth noting that this is endemic in filesystems. $ git grep mapping_set_gfp_mask.*FS drivers/block/loop.c: mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS)); fs/btrfs/disk-io.c: mapping_set_gfp_mask(fs_info->btree_inode->i_mapping, GFP_NOFS); fs/f2fs/inode.c: mapping_set_gfp_mask(inode->i_mapping, GFP_F2FS_ZERO); fs/f2fs/inode.c: mapping_set_gfp_mask(inode->i_mapping, GFP_F2FS_ZERO); fs/gfs2/glock.c: mapping_set_gfp_mask(mapping, GFP_NOFS); fs/gfs2/ops_fstype.c: mapping_set_gfp_mask(mapping, GFP_NOFS); fs/jfs/jfs_imap.c: mapping_set_gfp_mask(ip->i_mapping, GFP_NOFS); fs/jfs/super.c: mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); fs/nilfs2/gcinode.c: mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); fs/nilfs2/page.c: mapping_set_gfp_mask(mapping, GFP_NOFS); fs/reiserfs/xattr.c: mapping_set_gfp_mask(mapping, GFP_NOFS); fs/xfs/xfs_iops.c: mapping_set_gfp_mask(inode->i_mapping, (gfp_mask & ~(__GFP_FS)));