linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] init: don't try mounting device as nfs root unless type fully matches
@ 2012-05-05 15:06 Sasha Levin
  2012-05-07  8:54 ` Ingo Molnar
  2012-05-07  8:58 ` Ingo Molnar
  0 siblings, 2 replies; 5+ messages in thread
From: Sasha Levin @ 2012-05-05 15:06 UTC (permalink / raw)
  To: torvalds
  Cc: chuck.lever, linux, Trond.Myklebust, linux-nfs, linux-kernel,
	mingo, Sasha Levin

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, which has revealed
the issue this patch fixes.

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.

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").

Signed-off-by: Sasha Levin <levinsasha928@gmail.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 8dfa0de..d3f0aee 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -482,7 +482,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.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] init: don't try mounting device as nfs root unless type fully matches
  2012-05-05 15:06 [PATCH] init: don't try mounting device as nfs root unless type fully matches Sasha Levin
@ 2012-05-07  8:54 ` Ingo Molnar
  2012-05-07  8:56   ` Ingo Molnar
  2012-05-07  9:00   ` Sasha Levin
  2012-05-07  8:58 ` Ingo Molnar
  1 sibling, 2 replies; 5+ messages in thread
From: Ingo Molnar @ 2012-05-07  8:54 UTC (permalink / raw)
  To: Sasha Levin
  Cc: torvalds, chuck.lever, linux, Trond.Myklebust, linux-nfs,
	linux-kernel, mingo


* Sasha Levin <levinsasha928@gmail.com> 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, which has revealed
> the issue this patch fixes.

Just wondering, which tree is commit 6829a048 included in? It 
does not appear to be mainline AFAICS.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] init: don't try mounting device as nfs root unless type fully matches
  2012-05-07  8:54 ` Ingo Molnar
@ 2012-05-07  8:56   ` Ingo Molnar
  2012-05-07  9:00   ` Sasha Levin
  1 sibling, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2012-05-07  8:56 UTC (permalink / raw)
  To: Sasha Levin
  Cc: torvalds, chuck.lever, linux, Trond.Myklebust, linux-nfs,
	linux-kernel, mingo


* Ingo Molnar <mingo@kernel.org> wrote:

> 
> * Sasha Levin <levinsasha928@gmail.com> 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, which has revealed
> > the issue this patch fixes.
> 
> Just wondering, which tree is commit 6829a048 included in? It 
> does not appear to be mainline AFAICS.

appears to be:

43717c7daebf NFS: Retry mounting NFSROOT

The commit ID you cited is apparently one that got exposed to 
linux-next but got rebased subsequently, before it went 
upstream, or so.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] init: don't try mounting device as nfs root unless type fully matches
  2012-05-05 15:06 [PATCH] init: don't try mounting device as nfs root unless type fully matches Sasha Levin
  2012-05-07  8:54 ` Ingo Molnar
@ 2012-05-07  8:58 ` Ingo Molnar
  1 sibling, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2012-05-07  8:58 UTC (permalink / raw)
  To: Sasha Levin
  Cc: torvalds, chuck.lever, linux, Trond.Myklebust, linux-nfs,
	linux-kernel, mingo


* Sasha Levin <levinsasha928@gmail.com> 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, which has revealed
> the issue this patch fixes.
> 
> 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.
> 
> 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").
> 
> Signed-off-by: Sasha Levin <levinsasha928@gmail.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 8dfa0de..d3f0aee 100644
> --- a/init/do_mounts.c
> +++ b/init/do_mounts.c
> @@ -482,7 +482,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;

Acked-by: Ingo Molnar <mingo@elte.hu>

This bug actively broke my KVM bootup, it gave the impression 
that the bootup was hung, while it was just retrying for a 
looong time.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] init: don't try mounting device as nfs root unless type fully matches
  2012-05-07  8:54 ` Ingo Molnar
  2012-05-07  8:56   ` Ingo Molnar
@ 2012-05-07  9:00   ` Sasha Levin
  1 sibling, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2012-05-07  9:00 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: torvalds, chuck.lever, linux, Trond.Myklebust, linux-nfs,
	linux-kernel, mingo

On Mon, May 7, 2012 at 10:54 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Sasha Levin <levinsasha928@gmail.com> 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, which has revealed
>> the issue this patch fixes.
>
> Just wondering, which tree is commit 6829a048 included in? It
> does not appear to be mainline AFAICS.

It's 43717c7daebf10b43f12e68512484b3095bb1ba5 in mainline now.

Commit 6829a048 was from the -next tree (not sure which one of the
-next trees, but if you grab -next you'll see it there). I've prepared
this patch a while ago when it wasn't in mainline yet.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-07  9:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-05 15:06 [PATCH] init: don't try mounting device as nfs root unless type fully matches Sasha Levin
2012-05-07  8:54 ` Ingo Molnar
2012-05-07  8:56   ` Ingo Molnar
2012-05-07  9:00   ` Sasha Levin
2012-05-07  8:58 ` Ingo Molnar

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