Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753667AbdFSS7e (ORCPT + 2 others); Mon, 19 Jun 2017 14:59:34 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:52564 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753800AbdFSShy (ORCPT ); Mon, 19 Jun 2017 14:37:54 -0400 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: "Theodore Ts'o" , Willy Tarreau Subject: [PATCH 3.10 011/268] ext4: return EROFS if device is r/o and journal replay is needed Date: Mon, 19 Jun 2017 20:28:30 +0200 Message-Id: <1497897167-14556-12-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1497897167-14556-1-git-send-email-w@1wt.eu> References: <1497897167-14556-1-git-send-email-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Theodore Ts'o commit 4753d8a24d4588657bc0a4cd66d4e282dff15c8c upstream. If the file system requires journal recovery, and the device is read-ony, return EROFS to the mount system call. This allows xfstests generic/050 to pass. Signed-off-by: Theodore Ts'o Signed-off-by: Willy Tarreau --- fs/ext4/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index aa50d44..1fe383f 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3903,7 +3903,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) */ if (!test_opt(sb, NOLOAD) && EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) { - if (ext4_load_journal(sb, es, journal_devnum)) + err = ext4_load_journal(sb, es, journal_devnum); + if (err) goto failed_mount3; } else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) && EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER)) { -- 2.8.0.rc2.1.gbe9624a