Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4128963pxb; Mon, 30 Aug 2021 20:05:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhcsxA/DuAApHvG3jLtw6nEJqvBRHulMEFiqIkNRS7DGHRdlvmPcMA5/gbBzWcEhM+HPzP X-Received: by 2002:a05:6402:493:: with SMTP id k19mr9877926edv.386.1630379131656; Mon, 30 Aug 2021 20:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630379131; cv=none; d=google.com; s=arc-20160816; b=EL/+I+j/3qbKxYtzHIyxYpHdsEtnX9z9hVAxetRL1qC1nYJt6RLViGn4s7KCpsEkQ6 z22IGlk/R2kgvPNkTdnlBHkHJ4MOaEYsC9yW2LKLlZj/7Ze9nqfnRmh8kWGLq83nNJjW cmfiO3Ypcg/gDwWlhatAnIQinvDc5h/3JLNyT7MS4x2tTyxnj7KD+TeICeMdmW22Rrr5 c4KuYjB2386ZyUdT6y/pxT1mRQlmZEy4A4lXYqpbsIzHAOFY8I/fKDPo6pva/Fi6qIzq l0VVafKY8ISQ1Uzw5oGYpoaeCZtalP5NGYKHxJ7MqZqa5WbzwWmtHyRYCJZKvJD3ijRx w5mg== 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=659XOPgstoyPygqL5w52cgTq3sp5M/hhKCi8SJlIa1o=; b=ZPOzDCuvZjw6cNSVJ6Ga4Jy2fBlVNQy1cAIdpzVM1iYglf9ZdZOWCSRD9e2cJUSvjX QbifzmzjBSHG+g7XlrLoWSsGSr0bmwdEIJTdnbQ3mTLgeGSAaxsbkUSZ2za92l6bLFMx hYUHyp18wbbLAJqrePV2DFOEpHHxIfvy6NpTcmeeem9C1BqMxyGYO20UOIwedOJ3Q3cK PfSZYaX0QPwCfHbP8NeESkVwN1hraGP2IpRHORWoW+Tg1JxBPbENqhG1WpVLK6j6kWhI iZRiVeu9xh/WlGc8nBHULsj08FHDCCAdyL3lkTW+B3nSDLXgutLnC8oD7+1XeSbpf5Z3 6qNg== 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 c15si16620033ejk.388.2021.08.30.20.05.07; Mon, 30 Aug 2021 20:05:31 -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 S231776AbhHaDF5 (ORCPT + 99 others); Mon, 30 Aug 2021 23:05:57 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:52594 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229723AbhHaDF5 (ORCPT ); Mon, 30 Aug 2021 23:05:57 -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 17V34s6x029667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Aug 2021 23:04:54 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 1755A15C3E7E; Mon, 30 Aug 2021 23:04:54 -0400 (EDT) Date: Mon, 30 Aug 2021 23:04:53 -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 v4 3/6] ext4: make the updating inode data procedure atomic Message-ID: References: <20210826130412.3921207-1-yi.zhang@huawei.com> <20210826130412.3921207-4-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210826130412.3921207-4-yi.zhang@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Aug 26, 2021 at 09:04:09PM +0800, Zhang Yi wrote: > Now that ext4_do_update_inode() return error before filling the whole > inode data if we fail to set inode blocks in ext4_inode_blocks_set(). > This error should never happen in theory since sb->s_maxbytes should not > have allowed this, we have already init sb->s_maxbytes according to this > feature in ext4_fill_super(). So even through that could only happen due > to the filesystem corruption, we'd better to return after we finish > updating the inode because it may left an uninitialized buffer and we > could read this buffer later in "errors=continue" mode. > > This patch make the updating inode data procedure atomic, call > EXT4_ERROR_INODE() after we dropping i_raw_lock after something bad > happened, make sure that the inode is integrated, and also drop a BUG_ON > and do some small cleanups. > > Signed-off-by: Zhang Yi > Reviewed-by: Jan Kara Thanks, applied. - Ted