From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756685Ab2EEPF4 (ORCPT ); Sat, 5 May 2012 11:05:56 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:50396 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756208Ab2EEPFt (ORCPT ); Sat, 5 May 2012 11:05:49 -0400 From: Sasha Levin To: torvalds@linux-foundation.org Cc: chuck.lever@oracle.com, linux@razik.name, Trond.Myklebust@netapp.com, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@elte.hu, Sasha Levin Subject: [PATCH] init: don't try mounting device as nfs root unless type fully matches Date: Sat, 5 May 2012 17:06:35 +0200 Message-Id: <1336230395-5215-1-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.8.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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