public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches
@ 2012-01-07  9:12 Sasha Levin
  2012-01-07 16:57 ` Chuck Lever
  0 siblings, 1 reply; 9+ messages in thread
From: Sasha Levin @ 2012-01-07  9:12 UTC (permalink / raw)
  To: chuck.lever, linux, Trond.Myklebust
  Cc: penberg, linux-nfs, linux-kernel, 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.

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


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

* Re: [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches
  2012-01-07  9:12 [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches Sasha Levin
@ 2012-01-07 16:57 ` Chuck Lever
  2012-01-07 18:12   ` Jim Rees
  0 siblings, 1 reply; 9+ messages in thread
From: Chuck Lever @ 2012-01-07 16:57 UTC (permalink / raw)
  To: Sasha Levin; +Cc: linux, Trond.Myklebust, penberg, linux-nfs, linux-kernel

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@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 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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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





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

* Re: [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches
  2012-01-07 16:57 ` Chuck Lever
@ 2012-01-07 18:12   ` Jim Rees
  2012-01-09 12:14     ` Sasha Levin
  0 siblings, 1 reply; 9+ messages in thread
From: Jim Rees @ 2012-01-07 18:12 UTC (permalink / raw)
  To: Chuck Lever
  Cc: Sasha Levin, linux, Trond.Myklebust, penberg, linux-nfs,
	linux-kernel

Chuck Lever wrote:

  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.

The comment does imply that 6829a048 introduced a bug, but that's not true.
It uncovered a bug that was there before.

I would change the part about "now we don't immediately fail."  It didn't
immediately fail before, but the timeout was short enough that you wouldn't
notice it.

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

* Re: [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches
  2012-01-07 18:12   ` Jim Rees
@ 2012-01-09 12:14     ` Sasha Levin
  2012-03-31 15:21       ` Sasha Levin
  0 siblings, 1 reply; 9+ messages in thread
From: Sasha Levin @ 2012-01-09 12:14 UTC (permalink / raw)
  To: Jim Rees
  Cc: Chuck Lever, linux, Trond.Myklebust, penberg, linux-nfs,
	linux-kernel

On Sat, 2012-01-07 at 13:12 -0500, Jim Rees wrote:
> Chuck Lever wrote:
> 
>   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.
> 
> The comment does imply that 6829a048 introduced a bug, but that's not true.
> It uncovered a bug that was there before.
> 
> I would change the part about "now we don't immediately fail."  It didn't
> immediately fail before, but the timeout was short enough that you wouldn't
> notice it.

I tried to point out that 6829a048 changed the behavior which was
described in the first paragraph, I didn't try to imply that 6829a048 is
buggy on its own.

I'm fine with changing the changelog to whatever will make it clearer.

-- 

Sasha.


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

* Re: [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches
  2012-01-09 12:14     ` Sasha Levin
@ 2012-03-31 15:21       ` Sasha Levin
  2012-03-31 15:27         ` Chuck Lever
  0 siblings, 1 reply; 9+ messages in thread
From: Sasha Levin @ 2012-03-31 15:21 UTC (permalink / raw)
  To: Jim Rees
  Cc: Chuck Lever, linux, Trond.Myklebust, penberg, linux-nfs,
	linux-kernel

ping? I saw that this one didn't get pulled into the tree.

On Mon, Jan 9, 2012 at 1:14 PM, Sasha Levin <levinsasha928@gmail.com> wrote:
> On Sat, 2012-01-07 at 13:12 -0500, Jim Rees wrote:
>> Chuck Lever wrote:
>>
>>   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.
>>
>> The comment does imply that 6829a048 introduced a bug, but that's not true.
>> It uncovered a bug that was there before.
>>
>> I would change the part about "now we don't immediately fail."  It didn't
>> immediately fail before, but the timeout was short enough that you wouldn't
>> notice it.
>
> I tried to point out that 6829a048 changed the behavior which was
> described in the first paragraph, I didn't try to imply that 6829a048 is
> buggy on its own.
>
> I'm fine with changing the changelog to whatever will make it clearer.
>
> --
>
> Sasha.
>

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

* Re: [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches
  2012-03-31 15:21       ` Sasha Levin
@ 2012-03-31 15:27         ` Chuck Lever
  2012-03-31 21:09           ` Myklebust, Trond
  0 siblings, 1 reply; 9+ messages in thread
From: Chuck Lever @ 2012-03-31 15:27 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: Jim Rees, Sasha Levin, Lukas Razik, Pekka Enberg,
	Linux NFS Mailing List, LKML Kernel

Oops.  Trond?  This got dropped somewhere.


On Mar 31, 2012, at 11:21 AM, Sasha Levin wrote:

> ping? I saw that this one didn't get pulled into the tree.
> 
> On Mon, Jan 9, 2012 at 1:14 PM, Sasha Levin <levinsasha928@gmail.com> wrote:
>> On Sat, 2012-01-07 at 13:12 -0500, Jim Rees wrote:
>>> Chuck Lever wrote:
>>> 
>>>   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.
>>> 
>>> The comment does imply that 6829a048 introduced a bug, but that's not true.
>>> It uncovered a bug that was there before.
>>> 
>>> I would change the part about "now we don't immediately fail."  It didn't
>>> immediately fail before, but the timeout was short enough that you wouldn't
>>> notice it.
>> 
>> I tried to point out that 6829a048 changed the behavior which was
>> described in the first paragraph, I didn't try to imply that 6829a048 is
>> buggy on its own.
>> 
>> I'm fine with changing the changelog to whatever will make it clearer.
>> 
>> --
>> 
>> Sasha.
>> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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





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

* Re: [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches
  2012-03-31 15:27         ` Chuck Lever
@ 2012-03-31 21:09           ` Myklebust, Trond
  2012-03-31 21:21             ` Sasha Levin
  0 siblings, 1 reply; 9+ messages in thread
From: Myklebust, Trond @ 2012-03-31 21:09 UTC (permalink / raw)
  To: Chuck Lever
  Cc: Jim Rees, Sasha Levin, Lukas Razik, Pekka Enberg,
	Linux NFS Mailing List, LKML Kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2867 bytes --]

On Sat, 2012-03-31 at 11:27 -0400, Chuck Lever wrote:
> Oops.  Trond?  This got dropped somewhere.

I don't own the 'init' directory, and since quite frankly this isn't
related to NFS at all, it should be sent to Linus directly.

I'm quite happy to ack the patch if that would help.

Cheers
  Trond

> On Mar 31, 2012, at 11:21 AM, Sasha Levin wrote:
> 
> > ping? I saw that this one didn't get pulled into the tree.
> > 
> > On Mon, Jan 9, 2012 at 1:14 PM, Sasha Levin <levinsasha928@gmail.com> wrote:
> >> On Sat, 2012-01-07 at 13:12 -0500, Jim Rees wrote:
> >>> Chuck Lever wrote:
> >>> 
> >>>   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.
> >>> 
> >>> The comment does imply that 6829a048 introduced a bug, but that's not true.
> >>> It uncovered a bug that was there before.
> >>> 
> >>> I would change the part about "now we don't immediately fail."  It didn't
> >>> immediately fail before, but the timeout was short enough that you wouldn't
> >>> notice it.
> >> 
> >> I tried to point out that 6829a048 changed the behavior which was
> >> described in the first paragraph, I didn't try to imply that 6829a048 is
> >> buggy on its own.
> >> 
> >> I'm fine with changing the changelog to whatever will make it clearer.
> >> 
> >> --
> >> 
> >> Sasha.
> >> 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches
  2012-03-31 21:09           ` Myklebust, Trond
@ 2012-03-31 21:21             ` Sasha Levin
  2012-03-31 21:24               ` Myklebust, Trond
  0 siblings, 1 reply; 9+ messages in thread
From: Sasha Levin @ 2012-03-31 21:21 UTC (permalink / raw)
  To: Myklebust, Trond
  Cc: Chuck Lever, Jim Rees, Lukas Razik, Pekka Enberg,
	Linux NFS Mailing List, LKML Kernel, Ingo Molnar, Linus Torvalds

On Sat, Mar 31, 2012 at 11:09 PM, Myklebust, Trond
<Trond.Myklebust@netapp.com> wrote:
> On Sat, 2012-03-31 at 11:27 -0400, Chuck Lever wrote:
>> Oops.  Trond?  This got dropped somewhere.
>
> I don't own the 'init' directory, and since quite frankly this isn't
> related to NFS at all, it should be sent to Linus directly.
>
> I'm quite happy to ack the patch if that would help.

The patch which has triggered this whole story (6829a048 ("NFS: Retry
mounting NFSROOT")) modified init/ as well, and went in through the
NFS tree. Can't this patch follow the same path?

Anyhow, I've Cc'ed Linus in hopes that this patch can somehow find
it's way into 3.4.

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

* Re: [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches
  2012-03-31 21:21             ` Sasha Levin
@ 2012-03-31 21:24               ` Myklebust, Trond
  0 siblings, 0 replies; 9+ messages in thread
From: Myklebust, Trond @ 2012-03-31 21:24 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Chuck Lever, Jim Rees, Lukas Razik, Pekka Enberg,
	Linux NFS Mailing List, LKML Kernel, Ingo Molnar, Linus Torvalds

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1201 bytes --]

On Sat, 2012-03-31 at 23:21 +0200, Sasha Levin wrote:
> On Sat, Mar 31, 2012 at 11:09 PM, Myklebust, Trond
> <Trond.Myklebust@netapp.com> wrote:
> > On Sat, 2012-03-31 at 11:27 -0400, Chuck Lever wrote:
> >> Oops.  Trond?  This got dropped somewhere.
> >
> > I don't own the 'init' directory, and since quite frankly this isn't
> > related to NFS at all, it should be sent to Linus directly.
> >
> > I'm quite happy to ack the patch if that would help.
> 
> The patch which has triggered this whole story (6829a048 ("NFS: Retry
> mounting NFSROOT")) modified init/ as well, and went in through the
> NFS tree. Can't this patch follow the same path?

No. It touches generic code unlike the above patch, which _only_ touches
NFS-related code.

> Anyhow, I've Cc'ed Linus in hopes that this patch can somehow find
> it's way into 3.4.

Don't just Cc: Linus on this thread: send the patch to him directly (and
Cc: linux-kernel@vger.kernel.org).

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

end of thread, other threads:[~2012-03-31 21:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-07  9:12 [PATCH] nfs: Don't try mounting device as nfs root unless type fully matches Sasha Levin
2012-01-07 16:57 ` Chuck Lever
2012-01-07 18:12   ` Jim Rees
2012-01-09 12:14     ` Sasha Levin
2012-03-31 15:21       ` Sasha Levin
2012-03-31 15:27         ` Chuck Lever
2012-03-31 21:09           ` Myklebust, Trond
2012-03-31 21:21             ` Sasha Levin
2012-03-31 21:24               ` Myklebust, Trond

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox