mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyfox@gentoo.org>
To: xfs@oss.sgi.com
Cc: Sergei Trofimovich <slyfox@gentoo.org>, Ben Myers <bpm@sgi.com>,
	Alex Elder <elder@kernel.org>,
	linux-kernel@vger.kernel.org, Dave Chinner <dchinner@redhat.com>,
	Phil White <pwhite@sgi.com>
Subject: [PATCH] xfs: return -EINVAL instead of -EUCLEAN when mounting non-xfs
Date: Sun, 30 Dec 2012 02:16:50 +0300	[thread overview]
Message-ID: <1356823010-29768-1-git-send-email-slyfox@gentoo.org> (raw)
In-Reply-To: <20121230015615.6cc9e03c@sf>

It fixes boot panic when trying to boot from btrfs filesystem.
kernel tries to mount as xfs and gets fatal -EUCLEAN:

[    0.170000] VFS: Cannot open root device "ubda" or unknown-block(98,0): error -117
[    0.170000] Please append a correct "root=" boot option; here are the available partitions:
[    0.170000] 6200         1048576 ubda  driver: uml-blkdev
[    0.170000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(98,0)

init/do_mounts.c expects only -EINVAL as 'retry another' option.
Fixes regression introduced by commit 98021821a502db347bd9c7671beeee6e8ce07ea6

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
CC: Ben Myers <bpm@sgi.com>
CC: Alex Elder <elder@kernel.org>
CC: xfs@oss.sgi.com
CC: linux-kernel@vger.kernel.org
CC: Dave Chinner <dchinner@redhat.com>
CC: Phil White <pwhite@sgi.com>
---
 fs/xfs/xfs_mount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index da50846..379cac1 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -641,41 +641,41 @@ xfs_sb_read_verify(
 /*
  * We may be probed for a filesystem match, so we may not want to emit
  * messages when the superblock buffer is not actually an XFS superblock.
  * If we find an XFS superblock, the run a normal, noisy mount because we are
  * really going to mount it and want to know about errors.
  */
 static void
 xfs_sb_quiet_read_verify(
 	struct xfs_buf	*bp)
 {
 	struct xfs_sb	sb;
 
 	xfs_sb_from_disk(&sb, XFS_BUF_TO_SBP(bp));
 
 	if (sb.sb_magicnum == XFS_SB_MAGIC) {
 		/* XFS filesystem, verify noisily! */
 		xfs_sb_read_verify(bp);
 		return;
 	}
 	/* quietly fail */
-	xfs_buf_ioerror(bp, EFSCORRUPTED);
+	xfs_buf_ioerror(bp, EINVAL);
 }
 
 static void
 xfs_sb_write_verify(
 	struct xfs_buf	*bp)
 {
 	xfs_sb_verify(bp);
 }
 
 const struct xfs_buf_ops xfs_sb_buf_ops = {
 	.verify_read = xfs_sb_read_verify,
 	.verify_write = xfs_sb_write_verify,
 };
 
 static const struct xfs_buf_ops xfs_sb_quiet_buf_ops = {
 	.verify_read = xfs_sb_quiet_read_verify,
 	.verify_write = xfs_sb_write_verify,
 };
 
 /*
-- 
1.8.0.2


       reply	other threads:[~2012-12-29 23:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20121230015615.6cc9e03c@sf>
2012-12-29 23:16 ` Sergei Trofimovich [this message]
2012-12-29 23:32   ` Eric Sandeen
2012-12-30  2:29     ` Theodore Ts'o
2013-01-03 18:19   ` Christoph Hellwig
2013-01-08 19:48     ` Ben Myers

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=1356823010-29768-1-git-send-email-slyfox@gentoo.org \
    --to=slyfox@gentoo.org \
    --cc=bpm@sgi.com \
    --cc=dchinner@redhat.com \
    --cc=elder@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pwhite@sgi.com \
    --cc=xfs@oss.sgi.com \
    /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

all inboxes | Powered by JetHome®