nfs: Don't try mounting device as nfs root unless type fully matches
Subsystems (3)
PATCH 1/1 nfs: Don't try mounting device as nfs root unless type fully matches
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").
--- init/do_mounts.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
init/do_mounts.c +1 -1
@@ -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 ;
Signature · 1 line
1.7.8.2
Hi-
Quoted 8 lines · Sasha Levin
Currently, we'll try mounting any device who's major device number is
UNNAMED_MAJORas 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.
Quoted 6 lines
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.
Quoted 4 lines
This patch modifies the NFS type check to require device type to be '
Root_NFS' instead of requiring the device to have anUNNAMED_MAJORmajor. 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.
Quoted 25 lines
Signed-off-by Sasha Levin <[email protected]>---
init/do_mounts.c| 2 +-1 files changed, 1 insertions(+), 1 deletions(-)init/do_mounts.c +1
-1@@ -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 ;Signature · 6 lines
1.7.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Chuck Lever chuck[dot]lever[at]oracle[dot]com
Chuck Lever wrote:
Quoted 8 lines · Sasha Levin
Currently, we'll try mounting any device who's major device number is
UNNAMED_MAJORas 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.
Quoted 6 lines
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.
Quoted 23 lines · Jim Rees
Chuck Lever wrote:
Quoted 8 lines · Sasha Levin
Currently, we'll try mounting any device who's major device number is
UNNAMED_MAJORas 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.Quoted 6 lines
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.
Quoted 6 lines
The comment does imply that
6829a048introduced 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.
Signature · 1 line
Sasha.
ping? I saw that this one didn't get pulled into the tree.
Quoted 41 lines · Sasha Levin
Quoted 23 lines · Jim Rees
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_MAJORas 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. >
> Commit6829a048("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.Quoted 6 lines
The comment does imply that
6829a048introduced 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
6829a048changed the behavior which was described in the first paragraph, I didn't try to imply that6829a048is buggy on its own.I'm fine with changing the changelog to whatever will make it clearer.
--
Sasha.
Oops. Trond? This got dropped somewhere.
Quoted 48 lines · Sasha Levin
ping? I saw that this one didn't get pulled into the tree.
Quoted 35 lines · Sasha Levin
Quoted 23 lines · Jim Rees
Chuck Lever wrote:
Quoted 8 lines · Sasha Levin
Currently, we'll try mounting any device who's major device number is
UNNAMED_MAJORas 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.Quoted 6 lines
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.Quoted 6 lines
The comment does imply that
6829a048introduced 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
6829a048changed the behavior which was described in the first paragraph, I didn't try to imply that6829a048is buggy on its own.Quoted 6 lines
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Chuck Lever chuck[dot]lever[at]oracle[dot]com
T24gU2F0LCAyMDEyLTAzLTMxIGF0IDExOjI3IC0wNDAwLCBDaHVjayBMZXZlciB3cm90ZToNCj4g T29wcy4gIFRyb25kPyAgVGhpcyBnb3QgZHJvcHBlZCBzb21ld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FRvIHVuc3Vic2NyaWJlIGZyb20gdGhpcyBsaXN0OiBzZW5kIHRoZSBsaW5l ICJ1bnN1YnNjcmliZSBsaW51eC1uZnMiIGluDQo+ID4gdGhlIGJvZHkgb2YgYSBtZXNzYWdlIHRv IG1ham9yZG9tb0B2Z2VyLmtlcm5lbC5vcmcNCj4gPiBNb3JlIG1ham9yZG9tbyBpbmZvIGF0ICBo dHRwOi8vdmdlci5rZXJuZWwub3JnL21ham9yZG9tby1pbmZvLmh0bWwNCj4gDQoNCi0tIA0KVHJv bmQgTXlrbGVidXN0DQpMaW51eCBORlMgY2xpZW50IG1haW50YWluZXINCg0KTmV0QXBwDQpUcm9u ZC5NeWtsZWJ1c3RAbmV0YXBwLmNvbQ0Kd3d3Lm5ldGFwcC5jb20NCg0K
Quoted 7 lines · Trond
Quoted 1 line · Chuck Lever
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.
T24gU2F0LCAyMDEyLTAzLTMxIGF0IDIzOjIxICswMjAwLCBTYXNoYSBMZXZpbiB3cm90ZToNCj4g T24gU2F0LCBNYXIgMzEsIDIwMTIgYXQgMTE6MDkgUE0sIE15a2xlYnVzdCwgVHJvbmQNCj4gPFRy b25kLk15a2xlYnVzdEBuZXRhcHAuY29tPiB3cm90ZToNCj4gPiBPbiBTYXQsIDIwMTItMDMtMzEg YXQgMTE6MjcgLTA0MDAsIENodWNrIExldmVyIHdyb3RlOg0KPiA+PiBPb3BzLiAgVHJvbmQ/ICBU aGlzIGdvdCBkcm9wcGVkIHNvbWV3aGVyZS4NCj4gPg0KPiA+IEkgZG9uJ3Qgb3duIHRoZSAnaW5p dCcgZGlyZWN0b3J5LCBhbmQgc2lu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