From owner-svn-src-head@FreeBSD.ORG Wed Dec 31 06:08:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B615D6AB for ; Wed, 31 Dec 2014 06:08:31 +0000 (UTC) Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49D5464F5C for ; Wed, 31 Dec 2014 06:08:30 +0000 (UTC) Received: by mail-we0-f170.google.com with SMTP id w61so1963568wes.29 for ; Tue, 30 Dec 2014 22:08:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=OiN9jEOuLEB9LlYhxIGAZq1oSXQ5NUIexqV2Ptf0DfQ=; b=ibbNDVyBj16v23vtQA3tHZOj6RAyYkPeDBSCRzq5BnxH10ZE/l1kYgllNvF3wNSqBl o8UH1XIklYfPqALcYf49HaQRV082wt3uO53qZRXQZMUr3KZYEzPOgMjcpjxf3NaOxmTq nmbbKCfaL72LtdInpInBiE5S7N79UjGwKNAwzMo9nIJErbt0dRSj96lF3JoNcFmkBFBs Lu8qFCdod/+ayoeaFn9ZIWI4DwQbBRuiN2qwZEqfqf8P3i3aM7fQYO5jvNo/+jPcSWTi fdIF78sNfWP4YEAljM/EK0gjiaBrc2eenYl0dSV9EEtPkKCOsiIfvsU8on1nwibkhDK7 WJmQ== X-Gm-Message-State: ALoCoQnHybSjIsoj6Su3VtE1OEPwWUEag0RII8qVQD55NGsx3FXYTUGeTN/gSTtFEaS2SGrso1i3 X-Received: by 10.180.187.239 with SMTP id fv15mr92506202wic.38.1420005727764; Tue, 30 Dec 2014 22:02:07 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id h8sm45862050wiy.17.2014.12.30.22.02.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Dec 2014 22:02:06 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <54A39153.8040905@freebsd.org> Date: Wed, 31 Dec 2014 06:01:55 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: d@delphij.net, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r276123 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201412230931.sBN9VPMK017968@svn.freebsd.org> <54A35B88.9090102@delphij.net> In-Reply-To: <54A35B88.9090102@delphij.net> Content-Type: multipart/mixed; boundary="------------020201040309020109020201" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2014 06:08:31 -0000 This is a multi-part message in MIME format. --------------020201040309020109020201 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 31/12/2014 02:12, Xin Li wrote: > On 12/23/14 01:31, Steven Hartland wrote: >> Author: smh >> Date: Tue Dec 23 09:31:24 2014 >> New Revision: 276123 >> URL: https://svnweb.freebsd.org/changeset/base/276123 >> >> Log: >> Always sync the global ZFS config cache to reflect the new mosconfig >> >> This fixes out of date zpool.cache for root pools, which can cause issues >> such as confusion of zdb etc. >> >> MFC after: 1 month >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Tue Dec 23 08:51:30 2014 (r276122) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Tue Dec 23 09:31:24 2014 (r276123) >> @@ -536,8 +536,7 @@ spa_config_update(spa_t *spa, int what) >> /* >> * Update the global config cache to reflect the new mosconfig. >> */ >> - if (!spa->spa_is_root) >> - spa_config_sync(spa, B_FALSE, what != SPA_CONFIG_UPDATE_POOL); >> + spa_config_sync(spa, B_FALSE, what != SPA_CONFIG_UPDATE_POOL); >> >> if (what == SPA_CONFIG_UPDATE_POOL) >> spa_config_update(spa, SPA_CONFIG_UPDATE_VDEVS); > It seems like that this change breaks systems where not all pools are > available (e.g. some of pools are encrypted) at boot time, by removing > all these pools from the cache file. > > As a result, on the next boot, these pools would not be imported even > when the devices are available (geli attached), and reverting this > change would restore the system to its previous behavior. > > Perhaps it have exposed an existing bug? I've managed to reproduce this here with mdX backed test pools, and looking into it this is due to spa_config_sync: /* * Skip over our own pool if we're about to remove * ourselves from the spa namespace or any pool that * is readonly. Since we cannot guarantee that a * readonly pool would successfully import upon reboot, * we don't allow them to be written to the cache file. */ if ((spa == target && removing) || !spa_writeable(spa)) { continue; } This was added by upstream: https://github.com/illumos/illumos-gate/commit/fb02ae025247e3b662600e5a9c1b4c33ecab7d72 https://www.illumos.org/issues/3639 It seems the desired behavior was to exclude read only pools, to prevent them being mounted writable on reboot, but the check is too wide and also excludes unavailable pools too. The attached patch corrects the test to only check writable on active pools so I believe should fix the issue your seeing. If you can test it and lmk that would be great. Regards Steve --------------020201040309020109020201 Content-Type: text/plain; charset=windows-1252; name="spa_config.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="spa_config.patch" SW5kZXg6IHN5cy9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi9mcy96ZnMv c3BhX2NvbmZpZy5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9jZGRsL2NvbnRyaWIvb3BlbnNv bGFyaXMvdXRzL2NvbW1vbi9mcy96ZnMvc3BhX2NvbmZpZy5jCShyZXZpc2lvbiAyNzYxMjMp CisrKyBzeXMvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL3V0cy9jb21tb24vZnMvemZzL3Nw YV9jb25maWcuYwkod29ya2luZyBjb3B5KQpAQCAtMjQxLDcgKzI0MSw4IEBAIHNwYV9jb25m aWdfc3luYyhzcGFfdCAqdGFyZ2V0LCBib29sZWFuX3QgcmVtb3ZpbmcsCiAJCQkgKiB3ZSBk b24ndCBhbGxvdyB0aGVtIHRvIGJlIHdyaXR0ZW4gdG8gdGhlIGNhY2hlIGZpbGUuCiAJCQkg Ki8KIAkJCWlmICgoc3BhID09IHRhcmdldCAmJiByZW1vdmluZykgfHwKLQkJCSAgICAhc3Bh X3dyaXRlYWJsZShzcGEpKQorCQkJICAgIChzcGFfc3RhdGUoc3BhKSA9PSBQT09MX1NUQVRF X0FDVElWRSAmJgorCQkJICAgICFzcGFfd3JpdGVhYmxlKHNwYSkpKQogCQkJCWNvbnRpbnVl OwogCiAJCQltdXRleF9lbnRlcigmc3BhLT5zcGFfcHJvcHNfbG9jayk7Cg== --------------020201040309020109020201--