Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp647168pxt; Thu, 12 Aug 2021 06:41:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqHAfNO1pjdoPEaOodwtwwN+a3cfg2XEBZoHTiZ8grRrTyr7Oxpl0m1pM/HnM5lpPGltDj X-Received: by 2002:a50:99d9:: with SMTP id n25mr5613867edb.310.1628775711349; Thu, 12 Aug 2021 06:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628775711; cv=none; d=google.com; s=arc-20160816; b=QDHkktPFySQgeimVQ+ht+SkFsC8e6AEJthyOJZlD7raQ9HSSg3k1ohRKmY+3Vh74G9 qJmfsjwf/c1fG/WdlA9aYiFfsE5Domo/2sMEriuxVQGMyTCFB42t5VDc96S/fBLa7HaV EGgw9O90dew2eZ9IWbjiN9DY6MLAZtRNnueJ2qrhirSpcK3118aQNQgZcy1gG/KXauUz Uay4MguTITQR+sO/BniCpbH8U9NeDE1iWidfLTuln0t4B3nGStgNtlOl0vROoI63YcoL FAT9g5ZBBmSumZAsygcBBENEdg8/Pz+pJuxDnpvzTcV99y5LXIDXMjP9edbLAYUbG0eK r2ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ftldvm56N32FBKDd0CCHVOeViQnWhqhW1nBl9zqj/CY=; b=BsumMttgoAJfZsitRyJhx03+NFTGMbwrXtl6RX1y0EkyQDw6hjP7LqhNHJe1/Ob2Uq /xI876Bl6HlujHvSj5yxHM7Q+Sds+tkbYpDkTyWxT4upGFAmY6afijmvAnT/ygq3S5lL kpsRIPwxYDraI00kbhe3n0ur1RkMh++La5zTIbULcwlgc+gyDsQUdEFkx/oWB6xIZkGY 23OsEPiXnzv/WcQKPpuQlWpVi3AKPwynk53Sjj/SnAFp3WsLKuZQsULPqxebFbnBpfXz UW0ub8FKnWW45lkoz5jYHHP3CmIXVQzXS+tviygAz493w1RcgOWvVoLiGAux8nT8B1DD 06yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GvfRylOD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si2582896edd.67.2021.08.12.06.41.10; Thu, 12 Aug 2021 06:41:51 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GvfRylOD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237163AbhHLNjc (ORCPT + 99 others); Thu, 12 Aug 2021 09:39:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34063 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231602AbhHLNjb (ORCPT ); Thu, 12 Aug 2021 09:39:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628775546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ftldvm56N32FBKDd0CCHVOeViQnWhqhW1nBl9zqj/CY=; b=GvfRylOD2O2R0k9Li1r4KP8TPQGDOGswzCIICoZvtpwe7GIepmU50B42BV/3VkKx5s/u5S Ca2rsPKE8SxU+A1RJJza4JqRJJPe/HsiJUub847KLYcXWJ5GGFQNRU5JhHerP3u2PwDiGV 8h+6Jk1ROBzJGqJDoultaFOMRhFv4gA= Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-284-lCN4H-qtMPqh6SoGXakG1A-1; Thu, 12 Aug 2021 09:39:04 -0400 X-MC-Unique: lCN4H-qtMPqh6SoGXakG1A-1 Received: by mail-pj1-f69.google.com with SMTP id 2-20020a17090a1742b0290178de0ca331so4269275pjm.1 for ; Thu, 12 Aug 2021 06:39:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ftldvm56N32FBKDd0CCHVOeViQnWhqhW1nBl9zqj/CY=; b=CnCMvuMILs1WeBiTpxAg9iWEjR5T1K/dEpuwZvZdovhxbnTbq1y0+TBAl5kQe69Ry5 jD5yreBbotKb1Kz+XwVD4jiatiOjJrTM5icBaLdl/jjY4/6HpCWHmU7gzzfMTAcSjnP1 vaPq+CTYyi9AKT5yKZc+CqzAhcWiHLo5NWRvFzX0K5VQNp0lwI5WirXNDBgmDLx08s+k CfcYhcr/3SYr/bexrxNrjzGv53xdDCAcnYoGb2758M4FFMkc0Vbrik9QNJ++KY0uSH7b 7hPMHi8NmNjRRRxvsLBMPHzO4cc8tio3N45Izmht/8nlRh1vYTJ7mo5xjHzBCOCBneE5 Ce9A== X-Gm-Message-State: AOAM533o1w/QDRqUNBnaG0zZhIb03Vn9cDs2z/09pxWe3Kl9fQHr2GK+ EUlhmSwWOpyJVY98JNbazHIiDcQsWf2kVwYWmyCsLOxFtOq+bLttpOLmcjym/h3libCLWKcOilR Td3SWp/LY96lQyHTIb1ZHVGCVofkEpvhWAcBR1Q== X-Received: by 2002:a63:ba5c:: with SMTP id l28mr3862693pgu.311.1628775543509; Thu, 12 Aug 2021 06:39:03 -0700 (PDT) X-Received: by 2002:a63:ba5c:: with SMTP id l28mr3862677pgu.311.1628775543245; Thu, 12 Aug 2021 06:39:03 -0700 (PDT) MIME-Version: 1.0 References: <20210812124746.GA14675@quack2.suse.cz> In-Reply-To: <20210812124746.GA14675@quack2.suse.cz> From: Boyang Xue Date: Thu, 12 Aug 2021 21:38:51 +0800 Message-ID: Subject: Re: [kernel-5.11 regression] tune2fs fails after shutdown To: Jan Kara Cc: linux-ext4@vger.kernel.org, tytso@mit.edu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Thanks Jan! Yes. I will create a test case for fstests. Thanks, Boyang On Thu, Aug 12, 2021 at 8:47 PM Jan Kara wrote: > > Hello Boyang, > > On Thu 12-08-21 09:47:30, Boyang Xue wrote: > > (Adding the author of the commits) > > Hi Jan, > > > > The commit > > > > 81414b4dd48 ext4: remove redundant sb checksum recomputation > > > > breaks the original reproducer of > > > > 4274f516d4bc ext4: recalucate superblock checksum after updating free > > blocks/inodes > > > > I'm wondering is it expected please? > > Thanks for report! So for record the problem is not that superblock with > incorrect checksum would ever get to disk with my patches but the checksum > will be incorrect in the buffer cache until the moment we start writeout of > the superblock. And tune2fs accesses the buffer cache and sees the > incorrect (stale) checksum. It is impossible to fix this problem completely > (the tune2fs access is fundamentally racy) but yes, I guess returning the > checksum recalculation back will make the race window small and the cost is > small. I'll send a patch for this shortly. > > Also can you perhaps make this sequence into a fstests testcase for ext4 > filesystem so that we have it covered? Thanks! > > Honza > > > On Thu, Aug 5, 2021 at 10:35 AM Boyang Xue wrote: > > > > > > Hi, > > > > > > kernel commit > > > > > > 4274f516d4bc ext4: recalucate superblock checksum after updating free > > > blocks/inodes > > > > > > had been reverted by > > > > > > 81414b4dd48 ext4: remove redundant sb checksum recomputation > > > > > > since kernel-5.11-rc1. As a result, the original reproducer fails again. > > > > > > Reproducer: > > > ``` > > > mkdir mntpt > > > fallocate -l 256M mntpt.img > > > mkfs.ext4 -Fq -t ext4 mntpt.img 128M > > > LPDEV=$(losetup -f --show mntpt.img) > > > mount "$LPDEV" mntpt > > > cp /proc/version mntpt/ > > > ./godown mntpt # godown program attached. > > > umount mntpt > > > mount "$LPDEV" mntpt > > > tune2fs -l "$LPDEV" > > > ``` > > > > > > tune2fs fails with > > > ``` > > > tune2fs 1.46.2 (28-Feb-2021) > > > tune2fs: Superblock checksum does not match superblock while trying to > > > open /dev/loop0 > > > Couldn't find valid filesystem superblock. > > > ``` > > > > > > Tested on e2fsprogs-1.46.2 + kernel-5.14.0-0.rc3.29. I think it's a > > > regression. If this is the case, can we fix it again please? > > > > > > Thanks, > > > Boyang > > > -- > Jan Kara > SUSE Labs, CR >