From: Theodore Ts'o <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>, stable@vger.kernel.org
Subject: [PATCH 4/7] ext4: return EROFS if device is r/o and journal replay is needed
Date: Sun, 5 Feb 2017 02:34:27 -0500 [thread overview]
Message-ID: <20170205073430.9109-4-tytso@mit.edu> (raw)
In-Reply-To: <20170205073430.9109-1-tytso@mit.edu>
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 <tytso@mit.edu>
Cc: stable@vger.kernel.org
---
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 3fef82e79131..514e5fc59893 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3925,7 +3925,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
* root first: it may be modified in the journal!
*/
if (!test_opt(sb, NOLOAD) && ext4_has_feature_journal(sb)) {
- if (ext4_load_journal(sb, es, journal_devnum))
+ err = ext4_load_journal(sb, es, journal_devnum);
+ if (err)
goto failed_mount3a;
} else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) &&
ext4_has_feature_journal_needs_recovery(sb)) {
--
2.11.0.rc0.7.gbe5a750
next prev parent reply other threads:[~2017-02-05 7:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-05 7:34 [PATCH 1/7] ext4: fix inline data error paths Theodore Ts'o
2017-02-05 7:34 ` [PATCH 2/7] jbd2: don't leak modified metadata buffers on an aborted journal Theodore Ts'o
2017-02-05 7:34 ` [PATCH 3/7] ext4: preserve the needs_recovery flag when the journal is aborted Theodore Ts'o
2017-02-05 7:34 ` Theodore Ts'o [this message]
2017-02-05 7:34 ` [PATCH 5/7] ext4: rename s_resize_flags to s_ext4_flags Theodore Ts'o
2017-02-05 7:34 ` [PATCH 6/7] ext4: add shutdown bit and check for it Theodore Ts'o
2017-02-06 19:51 ` Andreas Dilger
2017-02-07 19:52 ` Theodore Ts'o
2017-02-05 7:34 ` [PATCH 7/7] ext4: add EXT4_IOC_GOINGDOWN ioctl Theodore Ts'o
2017-02-05 13:03 ` kbuild test robot
2017-02-06 0:50 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170205073430.9109-4-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).