Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp519481pxj; Thu, 17 Jun 2021 07:55:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIqW2OMX5F+k2qKDz63sth9lAH9RLcIENnh/9+lyaACDjtzQ8T+yU2dZ2x0zAxHXKM14+n X-Received: by 2002:a7b:c3da:: with SMTP id t26mr5518511wmj.63.1623941745716; Thu, 17 Jun 2021 07:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623941745; cv=none; d=google.com; s=arc-20160816; b=uRoTOh6cdmu+1YIgZ3AAVGkp4g7D1k/LKMadyv11nkd2wN+QBj2jbg4gN4rdFqnBq2 hDtMiAToEGy6ZOzJJFEZuwPFonHK8tXwUpKt5ire0blKkugXEql3gTbM/W2HN2LCxCmd lbju94gq7Mu582WLJie9eCu+2cKlU80Ijc4KBW4ZbqjRoyEkPVopVvXbIdMTIcEZyGEJ +8ShU+Pgu3WvTXurwvXsqmaODUN69w/0+FWqqBp3VQwACj7qNUlbCsy29LRMYYUl7AoE qiXTBTmyCrCsUn4AvgoXMYe/lP7HVw4A7Kr5/YAd7jdcheDjKh5EnNzYFxb1ahgVlSyB Rjsg== 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=/0b0T1BBTIEOAUk/W7gyCKD76Yi7r3LhJhaVLqoc9EU=; b=hX7q+HvidWtrjMf9A4JY9TT22VnJGBwLi3J4J232uf4ZzKt5LFwXftP864Yw71+n+9 6oVcXDvk69g5th/USzO73wnBd7h0TnWaS+nBPL+MXkJXJv+CeP+e9Zerry905NWYF1tk yNUEezTZpyPqQhKMkOdlF1pC+JKQbjKDF3fRtF1CAdyO1m/37QJVpqCYq3CMwI2SaeOf jDdlWzN91EKBYgkjzON4crAHgkDSYgKmabdBDJcbftXATzEgAyB2/+yZwq8cNgR1F1nU LDpPqrFf4ybzGLH7H9582SFyHnMxZn2Xfm3qjbSOZZXneXivtohOiBta3WItuGxh6XlO /SGA== 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 b29si5977702ejl.339.2021.06.17.07.55.17; Thu, 17 Jun 2021 07:55:45 -0700 (PDT) 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 S231666AbhFQOw0 (ORCPT + 99 others); Thu, 17 Jun 2021 10:52:26 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:48344 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231303AbhFQOw0 (ORCPT ); Thu, 17 Jun 2021 10:52:26 -0400 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 15HEo3d3005520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Jun 2021 10:50:03 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id DB47C15C3CB8; Thu, 17 Jun 2021 10:50:02 -0400 (EDT) Date: Thu, 17 Jun 2021 10:50:02 -0400 From: "Theodore Ts'o" To: Zhang Yi Cc: linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca, jack@suse.cz, yukuai3@huawei.com Subject: Re: [PATCH] ext4: cleanup in-core orphan list if ext4_truncate() failed to get a transaction handle Message-ID: References: <20210507071904.160808-1-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210507071904.160808-1-yi.zhang@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, May 07, 2021 at 03:19:04PM +0800, Zhang Yi wrote: > In ext4_orphan_cleanup(), if ext4_truncate() failed to get a transaction > handle, it didn't remove the inode from the in-core orphan list, which > may probably trigger below error dump in ext4_destroy_inode() during the > final iput() and could lead to memory corruption on the later orphan > list changes. > > EXT4-fs (sda): Inode 6291467 (00000000b8247c67): orphan list check failed! > 00000000b8247c67: 0001f30a 00000004 00000000 00000023 ............#... > 00000000e24cde71: 00000006 014082a3 00000000 00000000 ......@......... > 0000000072c6a5ee: 00000000 00000000 00000000 00000000 ................ > ... > > This patch fix this by cleanup in-core orphan list manually if > ext4_truncate() return error. > > Signed-off-by: Zhang Yi Applied, thanks. - Ted