Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2058355pxb; Fri, 5 Mar 2021 06:30:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeWKcYs/pshg41g3wHuSdRUttbie3BqKutQOM7vRGWClSnLKnOTLvm+iPGR2Wyez0MHHRI X-Received: by 2002:a17:906:5acd:: with SMTP id x13mr2407474ejs.211.1614954656368; Fri, 05 Mar 2021 06:30:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614954656; cv=none; d=google.com; s=arc-20160816; b=Y8u5LXl8EG2sYIn6EQKdEtJ0q9Tg8SZ14GVDbvgZH3nsqmz+dkn1nW4/WVKOybowX2 Rv2DASaM6lzch7nE1L8W4892u2uH/xXKJYpP6cV5NfV3uK0glUWCU588+DF0K2LAMkgQ Oe30razgYh785iF3ZcI9wSBeDyZuaCg6qKyk21QiDlxUqYwQ6e5W5Eb5jrMAeRA0FWjV DlD57VFuHBRGVB+InPv5t08Zi+z9HVBvgxBd+g1cZvcXoqls6jCIQKY31R/s4Xg+AaVs vEYnEw97UenV1iMx3fhSlATArP/Od5V9+dGg3szVai8TlCOPjP3mLG218DT+PD4QSAQ2 ya0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=hD7exvG9QcmztXunDFKyFiMz4DZIv5MWYo8s9sYjawk=; b=aXW+/zlGlY3FDVvygnAFiojK1s64W8tT6JOTVWOAPDyzYLqQJRajShWX9AiL+JSCpO eGfBlCM4ld1wu1bWBUpJ3JeqZSxO5TOR8y8tAhMxtRzfitRcPv+LfgjgT5ZEMK+F6prB 5Lctaz927pIy0mIDPF2f/fEs9DJWeBvE83KTW4FaKl3JJ/a970WLpRiFGzvE6qs/Bqde NFrxkeKq3mCrIksjCmjtH542wlPMAqZPSXJ5qBhSX+kshn/Ghkl1xJWmeyEs9oUhsOjD JAZdRLEybl9lzSdviqpFWPEQOpGIbx/QAWe3LBlCIkYIOwYoXie1ogm0KmTpYEwJ/ehR 04cQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si1449033ejb.431.2021.03.05.06.30.31; Fri, 05 Mar 2021 06:30:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230508AbhCEO34 (ORCPT + 99 others); Fri, 5 Mar 2021 09:29:56 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:45714 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229821AbhCEO3l (ORCPT ); Fri, 5 Mar 2021 09:29:41 -0500 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 125ETZ5d021788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 5 Mar 2021 09:29:36 -0500 Received: by cwcc.thunk.org (Postfix, from userid 15806) id C4BDB15C3A88; Fri, 5 Mar 2021 09:29:35 -0500 (EST) Date: Fri, 5 Mar 2021 09:29:35 -0500 From: "Theodore Ts'o" To: Jan Kara Cc: linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext4: Add checks to xattr code that we have appropriate reclaim context Message-ID: References: <20210222171626.21884-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210222171626.21884-1-jack@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Feb 22, 2021 at 06:16:26PM +0100, Jan Kara wrote: > Syzbot is reporting that ext4 can enter fs reclaim from kvmalloc() while > the transaction is started like: > > fs_reclaim_acquire+0x117/0x150 mm/page_alloc.c:4340 > might_alloc include/linux/sched/mm.h:193 [inline] > slab_pre_alloc_hook mm/slab.h:493 [inline] > slab_alloc_node mm/slub.c:2817 [inline] > __kmalloc_node+0x5f/0x430 mm/slub.c:4015 > kmalloc_node include/linux/slab.h:575 [inline] > kvmalloc_node+0x61/0xf0 mm/util.c:587 > kvmalloc include/linux/mm.h:781 [inline] > ext4_xattr_inode_cache_find fs/ext4/xattr.c:1465 [inline] > ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1508 [inline] > ext4_xattr_set_entry+0x1ce6/0x3780 fs/ext4/xattr.c:1649 > ext4_xattr_ibody_set+0x78/0x2b0 fs/ext4/xattr.c:2224 > ext4_xattr_set_handle+0x8f4/0x13e0 fs/ext4/xattr.c:2380 > ext4_xattr_set+0x13a/0x340 fs/ext4/xattr.c:2493 > > This should be impossible since transaction start sets PF_MEMALLOC_NOFS. > Add some assertions to the code to catch if something isn't working as > expected early. > > Link: https://lore.kernel.org/linux-ext4/000000000000563a0205bafb7970@google.com/ > Signed-off-by: Jan Kara Thanks, applied. - Ted