Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1302701pxv; Fri, 23 Jul 2021 05:12:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlXhR4WIaJ6Uu/14pWKn/iQ5bG3u2lv+WOI4WxjgecSb0b4OEwiLNssaI4GTXTactqw0Gc X-Received: by 2002:aa7:cb86:: with SMTP id r6mr5155690edt.181.1627042342620; Fri, 23 Jul 2021 05:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627042342; cv=none; d=google.com; s=arc-20160816; b=CnoJS3BVLTo3t/8gHiKOg+f3czDj5x0Sr6A5wZvPTXq9nbleZkw4FyU7qtQVhdVCvo 2dAmCQdpUXZz7VpY94vg6Vn1zJMIffae2Fw76iISohRk14WVDOrwNHQa0X6tRhdU/68D E6ynMtOMa2NoWgEcEkIIZl/y3cVc6lC7oneQneVMLx1K8TIj1UoeH1GhnPnmhXMBMZkI y0gVCPeT/oeu4bSsTE8qCrI5spo2Nd4BOpW9glRvOjeKgzULpyEzAqXKU9r9cKUadMVQ EYVjEDPtNC2YIr6dgYjScybzZmyh+3JEp8zYQeqFsVc4u0giT125hf54njMTP7U/fw61 f1dQ== 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=ora4u6RtN/yfZlKfhg1odGs/yfZ+3W7h3892Yk7wN7A=; b=lgMfM0wajrag2RuTKNoR94GaxvHAQKUOsBW2QU48J06qcECT6Ol//5GzcWH9/cPg9I 8nuLi20RHrlp7LDUkLL9zWRmEukalM+dI+8v0KbOGveKZr4M0LWCOmuU11hUYqgVspv1 PTnbkn1j8YtQBw1EVHnLc5Rf/MTXdLKD/pvh3qaWStljlrzSGGp46Q1mVKYjwS9QSm4t 77BMIPUQvH2xUv5wCQ6GNZ1XTi3sbic+NV4F5vjcZadUzcRB3NcxVu9b3mPBocgPsPc0 evvIZDXrDtlZp2SIOQTxGFa/dmhS/GyBoiVdH1H84eH/3Jvnx9upJqkdI2BP2ehZLRIL An5Q== 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 ee38si11893375edb.225.2021.07.23.05.11.52; Fri, 23 Jul 2021 05:12:22 -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 S234674AbhGWLau (ORCPT + 99 others); Fri, 23 Jul 2021 07:30:50 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:32925 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234385AbhGWLas (ORCPT ); Fri, 23 Jul 2021 07:30:48 -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 16NCB6pe031295 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Jul 2021 08:11:07 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id A071515C37C0; Fri, 23 Jul 2021 08:11:06 -0400 (EDT) Date: Fri, 23 Jul 2021 08:11:06 -0400 From: "Theodore Ts'o" To: yangerkun Cc: jack@suse.cz, linux-ext4@vger.kernel.org, yukuai3@huawei.com Subject: Re: [PATCH] ext4: flush s_error_work before journal destroy in ext4_fill_super Message-ID: References: <20210720062409.960734-1-yangerkun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210720062409.960734-1-yangerkun@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Jul 20, 2021 at 02:24:09PM +0800, yangerkun wrote: > 'commit c92dc856848f ("ext4: defer saving error info from atomic > context")' and '2d01ddc86606 ("ext4: save error info to sb through journal > if available")' add s_error_work to fix checksum error problem. But the > error path in ext4_fill_super can lead the follow BUG_ON. Can you share with me your test case? Your patch will result in the shrinker potentially not getting released in some error paths (which will cause other kernel panics), and in any case, once the journal is destroyed here: > @@ -5173,15 +5173,15 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > > ext4_xattr_destroy_cache(sbi->s_ea_block_cache); > sbi->s_ea_block_cache = NULL; > +failed_mount3a: > + ext4_es_unregister_shrinker(sbi); > +failed_mount3: > + flush_work(&sbi->s_error_work); > > if (sbi->s_journal) { > jbd2_journal_destroy(sbi->s_journal); > sbi->s_journal = NULL; > } > -failed_mount3a: > - ext4_es_unregister_shrinker(sbi); > -failed_mount3: > - flush_work(&sbi->s_error_work); sbi->s_journal is set to NULL, which means that in flush_stashed_error_work(), journal will be NULL, which means we won't call start_this_handle and so this change will not make a difference given the kernel stack trace in the commit description. Thanks, - Ted