Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp48466ybl; Thu, 29 Aug 2019 18:23:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzq/9i4DzGSQZXPBupFM/galSfr7OL1Or3H/9JOeq+hs8r/6Lgwv8Qh+P74FltFmZHhlXLm X-Received: by 2002:a17:902:7449:: with SMTP id e9mr11490822plt.242.1567128196372; Thu, 29 Aug 2019 18:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567128196; cv=none; d=google.com; s=arc-20160816; b=Vh0TO9b4SsBJl25UsoVukOYeo/BATe5pZ32ZTqfKazjFEsqGteOHGtu9W4NeHlTDAO 4fbFv2O2Hbftrd7OHXv+VmadBcZHQxwabxdDQH+TBShhE4Sr6GsvOSEXXQa7HfsDUIeV MGNOx7O6vBV17W8YrDFjijjm5kZhBkwZBazadZVsk+uRoTFZFiod8M21X5ZY/58HUEu4 F2UdCpkWiQh94ejhpvkAHwLNQ212VZNB03yj5WJi6e2xWFvzKziksRGLubKk28w8mFVN ch99Wr+VFHmdw5Mc3FGDWOZ5CaPN9EFpor2ua7Qpxmb4OnAuADNRoCWG4kPmtzy0bb2k ax4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=HaevHl3E/CvIUMyiGl0WZSYQnjZfaFsbH22D3SWIKas=; b=KRcgk4+b3mV5h4e84nijf77aRSleiaLVltzT8BU6sX+mcqU/tdIZUEdOw8piiPbMck PYmbKNoFMnL/qC/vcyCj7aKyx7DMy71Db7/1ipOxhYIxYK8o3oobYLc9OLIp85Gpqsxe mGsLEUuQK/P1TJ3WH1dLLAuaNPwfraSQPOLEBmP31C1xVAsmJ7lYNETRnE63tVqqXsZi E7P9uacHfsJr9TkTXIq8XLckaxK+WkEEX7lYxGf341npvL9y1E83shx8Ybgl0uc6ZkDj r9Y+fJkgVnuBam5caBofkiTc8H9yeQVUSEe9RZSoLLximytc+4yRLI60Ds+9EFHP+uXz X8FA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4si1157529plr.402.2019.08.29.18.22.48; Thu, 29 Aug 2019 18:23:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727242AbfH3BWr (ORCPT + 99 others); Thu, 29 Aug 2019 21:22:47 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:46620 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727176AbfH3BWr (ORCPT ); Thu, 29 Aug 2019 21:22:47 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-111.corp.google.com [104.133.0.111] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x7U1MbrB027165 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Aug 2019 21:22:38 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 0F41342049E; Thu, 29 Aug 2019 21:22:37 -0400 (EDT) Date: Thu, 29 Aug 2019 21:22:36 -0400 From: "Theodore Y. Ts'o" To: dann frazier Cc: Andreas Dilger , linux-ext4@vger.kernel.org, Jan Kara , Colin King , Ryan Harper Subject: Re: ext4 fsck vs. kernel recovery policy Message-ID: <20190830012236.GC10779@mit.edu> References: <5FEB4E1B-B21B-418D-801D-81FF7C6C069F@dilger.ca> <20190829225348.GA13045@xps13.dannf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829225348.GA13045@xps13.dannf> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org (Changing the cc from linux-fsdevel to linux-ext4.) On Thu, Aug 29, 2019 at 04:53:48PM -0600, dann frazier wrote: > JBD2: Invalid checksum recovering data block 517634 in log > > So is it correct to say that the checksum errors were identifying > filesystem correctness issues, and therefore e2fsck was needed to > correct them? That's correct. More precisely, checksum errors for journal blocks are presumed to mean that file system might be corrupt, so a full e2fsck check was needed to make sure the file system was consistent. > You're probably right - this issue is very easy to reproduce w/ > data=journal,journal_checksum. I was never able to reproduce it > otherwise. I've looked at the data block numbers that you've reported, and they come from a journald file. The problem is with data=journal + journal_checksum + mmap. Unfortunately, we don't handle that combination correctly at the moment. The fix is going to have to involve fixing __ext4_journalled_writepage() to call set_page_writeback() before it unlocks the page, adding a list of pages under data=journalled writeback which is attached to the transaction handle, have the jbd2 commit hook call end_page_writeback() on all of these pages, and then in the places where ext4 calls wait_for_stable_page() or grab_cache_page_write_begin(), we need to add: if (ext4_should_journal_data(inode)) wait_on_page_writeback(page); It's all relatively straightforward except for the part where we have to attach a list of pages to the currently running transaction. That will require adding some plumbing into the jbd2 layer. Dann, any interest in trying to code this fix? - Ted