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: <5FF522E0-132E-4A6A-A40F-5CCD08AF800A@oracle.com>
Date:	Sat, 7 Jan 2012 11:57:42 -0500
From:	Chuck Lever <chuck.lever@...cle.com>
To:	Sasha Levin <levinsasha928@...il.com>
Cc:	linux@...ik.name, Trond.Myklebust@...app.com, penberg@...nel.org,
	linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches

Hi-

On Jan 7, 2012, at 4:12 AM, Sasha Levin wrote:

> Currently, we'll try mounting any device who's major device number is
> UNNAMED_MAJOR as NFS root. This would happen for non-NFS devices as well (such
> as 9p devices) but it wouldn't cause any issues since mounting the device
> as NFS would fail quickly and the code proceeded to doing the proper mount:
> 
> 	[  101.522716] VFS: Unable to mount root fs via NFS, trying floppy.
> 	[  101.534499] VFS: Mounted root (9p filesystem) on device 0:18.
> 
> Commit 6829a048 ("NFS: Retry mounting NFSROOT") has introduced retries when
> mounting NFS root, which means that now we don't immediately fail and instead
> it takes an additional 90+ seconds until we stop retrying.
> 
> This meant that it would take an additional 90 seconds to boot when we're not
> using a device type which gets detected in order before NFS.

The long timeouts are kind of irrelevant, in my view.  The real problem is that NFS was tried at all in this case.  That behavior was not introduced by 6829a058.

> This patch modifies the NFS type check to require device type to be
> 'Root_NFS' instead of requiring the device to have an UNNAMED_MAJOR major.
> This makes boot process cleaner since we now won't go through the NFS mounting
> code at all when the device isn't an NFS root ("/dev/nfs").

Agreed.  I like this approach.

> Signed-off-by: Sasha Levin <levinsasha928@...il.com>
> ---
> init/do_mounts.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/init/do_mounts.c b/init/do_mounts.c
> index 06225d2..da76f2c 100644
> --- a/init/do_mounts.c
> +++ b/init/do_mounts.c
> @@ -475,7 +475,7 @@ void __init change_floppy(char *fmt, ...)
> void __init mount_root(void)
> {
> #ifdef CONFIG_ROOT_NFS
> -	if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) {
> +	if (ROOT_DEV == Root_NFS) {
> 		if (mount_nfs_root())
> 			return;
> 
> -- 
> 1.7.8.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




--
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