From owner-freebsd-stable@freebsd.org Sat Apr 8 11:26:46 2017 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B0CFD346E8 for ; Sat, 8 Apr 2017 11:26:46 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 44330A82 for ; Sat, 8 Apr 2017 11:26:46 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 439A0D346E5; Sat, 8 Apr 2017 11:26:46 +0000 (UTC) Delivered-To: stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43403D346E4 for ; Sat, 8 Apr 2017 11:26:46 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7093A81; Sat, 8 Apr 2017 11:26:45 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id u2so8158148wmu.0; Sat, 08 Apr 2017 04:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Y20cqAHkbeo3WT8DuIPy52Jok4/T6KptKgXhtTYUTXA=; b=RVi6qTxVgHvEtQ5/HapxZwLbXU/AyGHNiAGyt02VcnX+BwW310aqZkCzr2va1HHygJ S2vQzf7lUh5n6/WKjNpSRDF0LO6BkDAgHPYnNC8Zhbv+HQP4mejWqqzoFmSCMhn8Enee XLYJS49omzA9bMF+p0LrNizcm4YLgNeSmFanaCKnLkWW85oUyTQ1m7nYFO0PckmZbFvL LpMM+LmXu4ceYyr9cuHhanXKXrJzo+dl9c8lCpqeu0gu6Tl7g+8wp7ovvpl3pQ78xmIz JtC52N8gPrkpRTH9PU5GUpYVDdqq0UYtqDXq3/RAaT+flaNj7P95FgG6YijtTK9AkM4G IoOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=Y20cqAHkbeo3WT8DuIPy52Jok4/T6KptKgXhtTYUTXA=; b=sGoSuNg4lXFfCDKyqEPUFl2nYVHCfNMwsSAKsjGNnDbVnMrRjs0V+7UsWGwJC9Wvhu W1w0DlHh2gEEcXnvLUrAKuOS1Dco2Z6pb3EGV+TVDJL31jGqjLBnYd82U0BzbohimkeL bByri3yzN7zG/JS1NmqFu5JvarmHk+SINt4xLRP3uS9Do8Wb5QfQiXQegxlMzBPM6pz2 LXhqAeTbOEtcUAAwVpLDs7pCKFILmOsF1rZG0JjPiVBl8Qxl/k0f6VRDSxMhrB3W3cqj weJlJwzDltMjewPIl8grbW+iV3xVvq3gptTqjYWBU4W9b+TY5q8k5T+1mu4E4Wz3Kb9g sc+w== X-Gm-Message-State: AN3rC/7bFW/Kov7GAdaLpfLrqkUBJd2uG/+W0dioqPGoGCxLNaDSeKTSx76zIx148Y256A== X-Received: by 10.28.6.213 with SMTP id 204mr3111628wmg.68.1491650804072; Sat, 08 Apr 2017 04:26:44 -0700 (PDT) Received: from brick (cpc92310-cmbg19-2-0-cust934.5-4.cable.virginm.net. [82.9.227.167]) by smtp.gmail.com with ESMTPSA id w12sm9524378wra.21.2017.04.08.04.26.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Apr 2017 04:26:43 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sat, 8 Apr 2017 11:59:00 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Warner Losh Cc: Pete French , stable@freebsd.org, Andriy Gapon Subject: Re: moutnroot failing on zpools in Azure after upgrade from 10 to 11 due to lack of waiting for da0 Message-ID: <20170408105900.GA14604@brick> Mail-Followup-To: Warner Losh , Pete French , stable@freebsd.org, Andriy Gapon References: <6b397d83-e802-78ca-e24e-6d0713f07212@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Apr 2017 11:26:46 -0000 On 0316T1004, Warner Losh wrote: > [[ stupid mouse ]] > > On Thu, Mar 16, 2017 at 10:01 AM, Warner Losh wrote: > > On Thu, Mar 16, 2017 at 6:06 AM, Pete French wrote: > >>> I don't like the delay and retry approach at all. > >> > >> Its not ideal, but it is what we do for UFS after all... > >> > >>> Imagine that you told the kernel that you want to mount your root from a ZFS > >>> pool which is on a USB driver which you have already thrown out. Should the > >>> kernel just keep waiting for that pool to appear? > >> > >> I'm not talking about an infinite loop here, just making it honour > >> the 'vfs.mountroot.timeout' setting like it does ofr UFS. So it > >> should wait for the timeout I have set and then proceed as it would if > >> there had been no timeout. Default behaviout is for it to behave as it > >> does now, its onyl when you need the retry that you enable it. > > > > Put another way: With UFS is keeps retrying until the timeout expires. > > If the first try succeeds, the boot is immediate. > > > >> Right now this works for UFS, but not for ZFS, which is an inconsistency > >> that I dont like, and also means I am being forced down a UFS root > >> path if I require this. > > > > Yes. ZFS is special, but I don't think the assumptions behind its > > specialness are quite right: > > > > /* > > * In case of ZFS and NFS we don't have a way to wait for > > * specific device. Also do the wait if the user forced that > > * behaviour by setting vfs.root_mount_always_wait=1. > > */ > > if (strcmp(fs, "zfs") == 0 || strstr(fs, "nfs") != NULL || > > dev[0] == '\0' || root_mount_always_wait != 0) { > > vfs_mountroot_wait(); > > return (0); > > } > > > > So you can make it always succeed by forcing the wait, but that's lame... > > Later we check to see if a device by a given name is present. Since > ZFS doesn't present its pool names as devices to the rest of the > system, that's not going to work quite right. That's the real reason > that ZFS is special. It isn't that we can't wait for individual > devices, it's that we can't wait for the 'mount token' that we use for > what to mount to be 'ready'. NFS suffers from the same problem, but > since its device is always ready since it's stateless, it isn't as > noticeable. Not sure what you mean. The problem we handle ZFS and NFS in a different way (always waiting) is _exactly_ so that we don't have a way to wait for the individual device, like we can for eg UFS, and we have to fall back to mount tokens, which were used unconditionally before 11.0.