From owner-freebsd-current@freebsd.org Thu Mar 30 16:52:56 2017 Return-Path: Delivered-To: freebsd-current@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 53000D26A9E for ; Thu, 30 Mar 2017 16:52:56 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp002.me.com (st13p35im-asmtp002.me.com [17.164.199.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 267A577D for ; Thu, 30 Mar 2017 16:52:56 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp002.me.com by st13p35im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0ONM00O00X63U000@st13p35im-asmtp002.me.com> for freebsd-current@freebsd.org; Thu, 30 Mar 2017 15:52:40 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1490889160; bh=r6a0l4ljLG0QLZ8yw8ApvpnspTWZ8aFdOwXMfbSF+2M=; h=From:Content-type:Subject:Date:To:Message-id:MIME-version; b=OFjcEZYYB1ZfDDa3IIM1QTZ1dWSuYMTqC9m4ZDCSBaqT70+vy5Q/CYX3kzEc0SFsP HCd9vEKOesFrsNrnw4A1rLZShgvfCcmUg2q3lhcaUNJXnei2GKofcsAt1tiUEB/8RG T0kOEH27tYuNNykUlpE2N6PdC7S4gkFixHLrQR5hSTwR16NcTBXLXVz6tRVuwj5DU5 CjeY0NKlrUBxAzMrSbqG5Mr9PYdND/RmFGKgV2d8Yvb6uvWAUqeTMXWsnGycRwzqCw kYlL6kafh1o/V5n3QuWbOXycjz73pLdT5oDUztYaFa4leQuk2LqjI/343zjCt51cx6 ffrzvu7F1Lyag== Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0ONM00FYNXFO3B00@st13p35im-asmtp002.me.com> for freebsd-current@freebsd.org; Thu, 30 Mar 2017 15:52:39 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-30_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=6 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1703300139 From: Toomas Soome X-Priority: 3 Subject: D10203: loader: zfs reader should check all labels Date: Thu, 30 Mar 2017 18:52:35 +0300 References: To: FreeBSD Current Message-id: MIME-version: 1.0 (Mac OS X Mail 10.3 \(3273\)) X-Mailer: Apple Mail (2.3273) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 16:52:56 -0000 Hi! Sorry about forward, but this patch is something a bit more complicated = and if we have some people willing to test, it would be really nice:) I = have had it around for my illumos port for some time now, but those = small details about the zfsboot/gptzfsboot etc sometimes do count a = lot=E2=80=A6=20 thanks, toomas > Begin forwarded message: >=20 > From: "tsoome (Toomas Soome)" > Subject: [Differential] D10203: loader: zfs reader should check all = labels > Date: 30. m=C3=A4rts 2017 18:39.44 GMT+3 > To: tsoome@me.com > Reply-To: D10203+574+d76c8a36ba3c3f0a@reviews.freebsd.org >=20 > tsoome created this revision. > Herald added a subscriber: delphij. >=20 > REVISION SUMMARY > The current zfs reader is only checking first label from each device, = however, > we do have 4 labels on device and we should check all 4 to be = protected > against disk failures and incomplete label updates. >=20 > The difficulty is about the fact that 2 label copies are in front of = the > pool data, and 2 are at the end, which means, we have to know the = size of > the pool data area. >=20 > Since we have now the mechanism from common/disk.c to use the = partition > information, it does help us in this task; however, there are still = some > corner cases. >=20 > Namely, if the pool is created without partition, directly on the = disk, > and firmware will give us the wrong size for the disk, we only can = check > the first two label copies. >=20 > REPOSITORY > rS FreeBSD src repository >=20 > REVISION DETAIL > https://reviews.freebsd.org/D10203 >=20 > AFFECTED FILES > sys/boot/efi/boot1/zfs_module.c > sys/boot/efi/loader/main.c > sys/boot/i386/common/drv.h > sys/boot/i386/loader/main.c > sys/boot/i386/zfsboot/zfsboot.c > sys/boot/zfs/libzfs.h > sys/boot/zfs/zfsimpl.c >=20 > EMAIL PREFERENCES > https://reviews.freebsd.org/settings/panel/emailpreferences/ >=20 > To: tsoome, allanjude, imp, avg > Cc: delphij