lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50DF7D7C.50104@sandeen.net>
Date:	Sat, 29 Dec 2012 17:32:12 -0600
From:	Eric Sandeen <sandeen@...deen.net>
To:	Sergei Trofimovich <slyfox@...too.org>
CC:	xfs@....sgi.com, Alex Elder <elder@...nel.org>,
	Dave Chinner <dchinner@...hat.com>,
	linux-kernel@...r.kernel.org, Ben Myers <bpm@....com>,
	Phil White <pwhite@....com>
Subject: Re: [PATCH] xfs: return -EINVAL instead of -EUCLEAN when mounting
 non-xfs

On 12/29/12 5:16 PM, Sergei Trofimovich wrote:
> 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

yeah, that should work; great minds think alike ;)  Our patches
crossed in the ether I guess.

XFS uses EWRONGFS as an alias for EINVAL internally in these cases,
so maybe we should stick with that for consistency, *shrug*

-Eric

> Signed-off-by: Sergei Trofimovich <slyfox@...too.org>
> CC: Ben Myers <bpm@....com>
> CC: Alex Elder <elder@...nel.org>
> CC: xfs@....sgi.com
> CC: linux-kernel@...r.kernel.org
> CC: Dave Chinner <dchinner@...hat.com>
> CC: Phil White <pwhite@....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,
>  };
>  
>  /*
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ