From patchwork Thu Mar 8 05:53:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyson Nottingham X-Patchwork-Id: 882968 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="epezGCHu"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zxfpZ6nwcz9sXk for ; Thu, 8 Mar 2018 16:54:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966138AbeCHFyM (ORCPT ); Thu, 8 Mar 2018 00:54:12 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:39910 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966306AbeCHFyI (ORCPT ); Thu, 8 Mar 2018 00:54:08 -0500 Received: by mail-pf0-f194.google.com with SMTP id u5so1961850pfh.6 for ; Wed, 07 Mar 2018 21:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=qwWuHeAFxOiCHm6D/nQssG95ztAYN7X7ZuyBfYs6lfQ=; b=epezGCHuQ7X8c4Jjl7YSrAVgre6bwUnxvAlRQQ4YPsqtf3D7L1Egx1Ra3UUgppUYv7 v6mqqe6QvbGaxDyp3aYyWCYB3b/LQUBiM43lOB9N1CjLlmRtb552lUxn9Y6KthbXhzEy OUBwz4fp4Z0eIjelHkkVpV50hGK7bRIoy741HOHnMkRjNhzlSrRmkqIfx4u/0/rf+8cI fn8iPP/yhrJ/uBUW4hFQKKQryyfG9L/aMuo9s3bguFATql9X3nbI4pIMl/tLTuXIeKXc REfYyxM3Xr9pKTP3x7U/I4OR+eLB0Ap7TBGELQ6C+d5nbQ0hbVSnnPd5lTOF0aLRT9IC 0eOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=qwWuHeAFxOiCHm6D/nQssG95ztAYN7X7ZuyBfYs6lfQ=; b=fNgrsKMubqoFHcYxso9/4HVHbimLCMKpyBnkpTOZ6XZLcm/aXc8bU9rrEcPbZYVK3I cBbSRC8liKiY084xgCvLjVTdLlG7lzIYl+SRCVfsF1LXQA065RnlnGggItdE4xx9G402 7MfRbwptnbVtA7lekm+f56quzuheF1Ekjrq38VbOFEckiD6KVHlivev+qimVIkmTV7Kr 2LIItlLDZTGB60dTFrezWrBvjCr+KNYtyw2z1SyNIzoqrZJcmknRvHiN395pwkIUMaVq gCktbfwrqIzHhl8DaFOPFCI8MfPz2HOkdfk527bzHzoLFWC0sTpjCC/7HNJC1Miog2// yMZQ== X-Gm-Message-State: APf1xPCKz5cs3y3SFezrIjMVGVlRAui3laD3PwbcasW6ufiIWXFzgTsl c6mxOBPfb1SX0cA2/DE05e6F3Ck6Azc= X-Google-Smtp-Source: AG47ELs1VB+sIcbcY+QQBka/Ytmjy7VHOOeylm8wteZ3f9CB0zXQw6tQyXVzk/GSyTP8JIFXTFaIVw== X-Received: by 10.98.73.89 with SMTP id w86mr24982036pfa.227.1520488447400; Wed, 07 Mar 2018 21:54:07 -0800 (PST) Received: from localhost.localdomain (c-73-11-197-250.hsd1.wa.comcast.net. [73.11.197.250]) by smtp.gmail.com with ESMTPSA id f11sm14894158pfa.112.2018.03.07.21.54.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Mar 2018 21:54:06 -0800 (PST) From: Tyson Nottingham To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, adilger.kernel@dilger.ca, Tyson Nottingham Subject: [PATCH 3/3] ext4: don't show data= option if defaulted Date: Wed, 7 Mar 2018 21:53:38 -0800 Message-Id: <9266892b77a6e76b532abc2e3d16978a34ba84cc.1520480776.git.tgnottingham@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Previously, mount -l would show data= even if the ext4 default journaling mode was being used. Change this to be consistent with the rest of the options. Ext4 already did the right thing when the journaling mode being used matched the one specified in the superblock's default mount options. The reason it failed to do the right thing for the ext4 defaults is that, when set, they were never included in sbi->s_def_mount_opt (unlike the superblock's defaults, which were). Signed-off-by: Tyson Nottingham --- Before: (Without any default journaling mode configured in superblock or mount option, ext4 will use its own default, which is ordered in this case.) $ sudo mount -o loop=$(losetup -f) image.ext4 mnt $ grep data /proc/fs/ext4/loop0/options data=ordered $ mount -l | grep image /home/tgnottingham/image.ext4 on /home/tgnottingham/mnt type ext4 (rw,relatime,data=ordered) data=ordered is still displayed, even though the ext4 default was used. After: $ sudo mount -o loop=$(losetup -f) image.ext4 mnt $ grep data /proc/fs/ext4/loop0/options data=ordered $ mount -l | grep image /home/tgnottingham/image.ext4 on /home/tgnottingham/mnt type ext4 (rw,relatime) data=ordered is not displayed, since it was the default. tgnottingham@kernel-dev:~$ sudo mount -o loop=$(losetup -f),data=journal image.ext4 mnt $ grep data /proc/fs/ext4/loop0/options data=journal $ mount -l | grep image /home/tgnottingham/image.ext4 on /home/tgnottingham/mnt type ext4 (rw,relatime,nodelalloc,data=journal) data=journal is displayed, since it was not the default. Default mount options stored in superblock were tested but not shown. --- fs/ext4/super.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 7437ed0..7fbe7f4 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4091,10 +4091,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) * cope, else JOURNAL_DATA */ if (jbd2_journal_check_available_features - (sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE)) + (sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE)) { set_opt(sb, ORDERED_DATA); - else + sbi->s_def_mount_opt |= EXT4_MOUNT_ORDERED_DATA; + } else { set_opt(sb, JOURNAL_DATA); + sbi->s_def_mount_opt |= EXT4_MOUNT_JOURNAL_DATA; + } break; case EXT4_MOUNT_ORDERED_DATA: