From patchwork Mon Jul 23 20:21:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 172737 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id F05242C035D for ; Tue, 24 Jul 2012 06:21:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754608Ab2GWUVu (ORCPT ); Mon, 23 Jul 2012 16:21:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20174 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754160Ab2GWUVt (ORCPT ); Mon, 23 Jul 2012 16:21:49 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6NKLlB2014198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Jul 2012 16:21:47 -0400 Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6NKLjkV002123 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 23 Jul 2012 16:21:46 -0400 Message-ID: <500DB259.8070901@redhat.com> Date: Mon, 23 Jul 2012 15:21:45 -0500 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: "Theodore Ts'o" CC: ext4 development Subject: Re: How should e2fsck clear s_errno/j_errno on an ro mount? References: <5009E62E.3020608@redhat.com> <20120721003953.GA9399@thunk.org> <500D7BCB.2060806@redhat.com> <20120723191410.GB783@thunk.org> In-Reply-To: <20120723191410.GB783@thunk.org> X-Enigmail-Version: 1.4.3 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 7/23/12 2:14 PM, Theodore Ts'o wrote: >> nWell, I tested e2fsprogs from git and saw the same trouble. Let me >> look more closely at that commit. > > Hmm, would it be possible to send me /tmp/loop3.qcow.bz2 after running: > > e2image -Q /dev/loop3 /tmp/loop3.qcow > bzip2 /tmp/loop3.qcow > > Regardless of what the problem ends up being, this looks like > something for our regression test suite.... > > - Ted > Sure I can do that, will do it offline. FWIW, the commit you mentioned changes e2fsck_check_ext3_journal, and we only get there from main() like this: if ((ctx->mount_flags & EXT2_MF_MOUNTED) && !(sb->s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER)) goto skip_journal; retval = e2fsck_check_ext3_journal(ctx); In my case I am mounted ro and recovery is done, so EXT3_FEATURE_INCOMPAT_RECOVER is not, set, and so we skip over it with the goto. or else from here: if (sb->s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER) { if (ctx->options & E2F_OPT_READONLY) { ... } else { ... retval = e2fsck_run_ext3_journal(ctx); And again, I've already done recovery and am mounted RO so we won't go that way. If make the first test above a little later: it clears it up for me but TBH I'm not totally clear on what all is going on here. -Eric --- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 94260bd..73aa028 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1424,10 +1424,6 @@ failure: fprintf(ctx->logf, "Filesystem UUID: %s\n", e2p_uuid2str(sb->s_uuid)); - if ((ctx->mount_flags & EXT2_MF_MOUNTED) && - !(sb->s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER)) - goto skip_journal; - /* * Make sure the ext3 superblock fields are consistent. */ @@ -1439,6 +1435,10 @@ failure: fatal_error(ctx, 0); } + if ((ctx->mount_flags & EXT2_MF_MOUNTED) && + !(sb->s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER)) + goto skip_journal; + /* * Check to see if we need to do ext3-style recovery. If so, * do it, and then restart the fsck.