From patchwork Mon Nov 7 15:47:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 124117 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 507481007D4 for ; Tue, 8 Nov 2011 02:48:06 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751715Ab1KGPsE (ORCPT ); Mon, 7 Nov 2011 10:48:04 -0500 Received: from li9-11.members.linode.com ([67.18.176.11]:52743 "EHLO test.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060Ab1KGPsD (ORCPT ); Mon, 7 Nov 2011 10:48:03 -0500 Received: from root (helo=tytso-glaptop.cam.corp.google.com) by test.thunk.org with local-esmtp (Exim 4.69) (envelope-from ) id 1RNRQW-0001V9-FM; Mon, 07 Nov 2011 15:48:00 +0000 Received: from tytso by tytso-glaptop.cam.corp.google.com with local (Exim 4.71) (envelope-from ) id 1RNRQV-0004O0-MG; Mon, 07 Nov 2011 10:47:59 -0500 Date: Mon, 7 Nov 2011 10:47:59 -0500 From: Ted Ts'o To: Matt Parnell Cc: Eric Sandeen , linux-ext4@vger.kernel.org Subject: Re: Bug In ext4 in kernels > 2.6.39 - Not mounting with arguments/options I specify in fstab on root remount Message-ID: <20111107154759.GB24234@thunk.org> References: <4E6F6D89.5040905@redhat.com> <20111009234433.GU7948@thunk.org> <4EA0E72D.8020305@gmail.com> <20111022050031.GC4196@thunk.org> <4EA27607.20407@gmail.com> <20111022093218.GF4196@thunk.org> <4EB7416A.7080006@gmail.com> <4EB76C21.5060104@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4EB76C21.5060104@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on test.thunk.org); SAEximRunCond expanded to false Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sun, Nov 06, 2011 at 09:26:57PM -0800, Matt Parnell wrote: > I figured it out. data=writeback isn't needed and is done by default > if there's no journal, as per commit > 373cd5c53d5ea6622c319ecd84e29e2737d488bd http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=373cd5c53d5ea6622c319ecd84e29e2737d488bd > > ...sorry about throwing you guys through loops over this, although > I'm guessing there's still a bug in that the kernel should just warn > the user about the option when it's used and otherwise ignore it > instead of breaking if there's no journal. Ah, OK. It wasn't clear to me that you were running without a year. You're right, we shouldn't complain in that case, since we ignore the messages when mounting the file system. Actually, we parse the options when we are mounting the file system, but then we zero them out when we discover that there's no journal; but in any case, we should similarly ignore the pointless data=* mount options (for a file system w/o a journal) on the remount operation as well. - Ted commit eb513689c97e3e73bb9b4459d490a8e894b4a546 Author: Theodore Ts'o Date: Mon Nov 7 10:47:42 2011 -0500 ext4: ignore journalled data options on remount if fs has no journal This avoids a confusing failure in the init scripts when the /etc/fstab has data=writeback or data=journal but the file system does not have a journal. So check for this case explicitly, and warn the user that we are ignoring the (pointless, since they have no journal) data=* mount option. Signed-off-by: "Theodore Ts'o" --- 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/fs/ext4/super.c b/fs/ext4/super.c index 9953d80..0435013 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1683,7 +1683,9 @@ static int parse_options(char *options, struct super_block *sb, data_opt = EXT4_MOUNT_WRITEBACK_DATA; datacheck: if (is_remount) { - if (test_opt(sb, DATA_FLAGS) != data_opt) { + if (!sbi->s_journal) + ext4_msg(sb, KERN_WARNING, "Remounting file system with no journal so ignoring journalled data option"); + else if (test_opt(sb, DATA_FLAGS) != data_opt) { ext4_msg(sb, KERN_ERR, "Cannot change data mode on remount"); return 0;