From owner-freebsd-ports@freebsd.org Sat Jul 7 20:40:34 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E088A10278F1 for ; Sat, 7 Jul 2018 20:40:33 +0000 (UTC) (envelope-from trashcan@ellael.org) Received: from mx1.enfer-du-nord.net (mx1.enfer-du-nord.net [IPv6:2001:41d0:302:1100::7:9a96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DB9C8AD9D; Sat, 7 Jul 2018 20:40:32 +0000 (UTC) (envelope-from trashcan@ellael.org) Received: from [IPv6:2003:e9:7f1c:c801:1da8:4cbe:c58d:a0cc] (p200300E97F1CC8011DA84CBEC58DA0CC.dip0.t-ipconnect.de [IPv6:2003:e9:7f1c:c801:1da8:4cbe:c58d:a0cc]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.enfer-du-nord.net (Postfix) with ESMTPSA id 41NNlK0b5jzT5; Sat, 7 Jul 2018 22:40:29 +0200 (CEST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail.enfer-du-nord.net From: Michael Grimm Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: beadm-1.2.8: erroneous beadm create Message-Id: <5A4EB662-9562-47E4-A436-FAAAFFF524C6@ellael.org> Date: Sat, 7 Jul 2018 22:40:26 +0200 Cc: bdrewery@FreeBSD.org To: Mailing List FreeBSD Ports X-Mailer: Apple Mail (2.3445.8.2) X-Spam-Status: No, score=1.4 required=5.0 tests=RDNS_NONE,TW_ZF autolearn=no autolearn_force=no version=3.4.1 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail.mer-waases.lan X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 20:40:34 -0000 Hi -- I happen to run a boot environment with two zfs filesystems without any = zfs property defined that trigger an error with the latest beadm-1.2.8. Example BE of mine: zp0/ROOT/11r336056 13.5G 463M 95.1M 27.2G = 972M 2.15x / zp0/ROOT/11r336056/_jails 672M 672M 0 1.09G = 1.09G 1.75x /usr/home/jails zp0/ROOT/11r336056/usr 11.7G 6.42G 3.40G 24.2G = 13.7G 2.22x /usr zp0/ROOT/11r336056/usr/local 321M 299M 21.8M 505M = 484M 1.77x /usr/local zp0/ROOT/11r336056/usr/src 1.60G 1.51G 96.2M 2.91G = 2.82G 2.13x /usr/src zp0/ROOT/11r336056/var 586M 577M 8.64M 779M = 764M 1.33x /var Both zp0/ROOT/11r336056/usr/local and zp0/ROOT/11r336056/usr/src do not = have any zfs property defined, thus the new beadm-1.2.8 will run into an = error when trying to create a new BE: root> beadm create B1 cannot create 'zp0/ROOT/B1/usr/local': invalid property '' Ok, after adding some debugging code and a comparison with the previous = version I found the cause: root> ./beadm-1.2.8-patched create B1 zp0/ROOT/11r336056 | -o snapdir=3D"hidden" -o mountpoint=3D"/" zp0/ROOT/11r336056 | -o mountpoint=3D"/usr/home/jails" zp0/ROOT/11r336056 | -o snapdir=3D"hidden" -o setuid=3D"on" -o = mountpoint=3D"/usr" zp0/ROOT/11r336056 | -o =3D"" cannot create 'zp0/ROOT/B1/usr/local': invalid property '' The previous version didn't trigger missing zfs properties because it = doesn't add an empty string "" to '-o': root> ./beadm-1.2.8-patched create B1 zp0/ROOT/11r336056 | -o snapdir=3Dhidden -o mountpoint=3D/ zp0/ROOT/11r336056 | -o mountpoint=3D/usr/home/jails zp0/ROOT/11r336056 | -o snapdir=3Dhidden -o setuid=3Don -o = mountpoint=3D/usr zp0/ROOT/11r336056 | -o =3D zp0/ROOT/11r336056 | -o mountpoint=3D/usr/src zp0/ROOT/11r336056 | -o snapdir=3Dhidden -o mountpoint=3D/var Created successfully Workaround to me is the following patch (beadm-1.2.7 approach): [snip] root> diff -u beadm-1.2.8 beadm-1.2.8-patched --- beadm-1.2.8 2018-07-07 16:17:19.231902000 +0200 +++ beadm-1.2.8-patched 2018-07-07 22:00:19.740611000 +0200 @@ -213,7 +213,7 @@ local OPTS=3D"" while read NAME PROPERTY VALUE do - local OPTS=3D"-o ${PROPERTY}=3D\"${VALUE}\" ${OPTS}" + local OPTS=3D"-o ${PROPERTY}=3D${VALUE} ${OPTS}" done << EOF $( zfs get -o name,property,value -s local,received -H all ${FS} | awk = '!/[\t ]canmount[\t ]/' ) EOF [snap] Well, I do see the point of embedding variables with ", but I do also = believe that checking for a null string and removing that resulting =E2=80= =A6 -o =3D"" =E2=80=A6 before applying the final 'zfs clone' command with it would be = a much better patch.=20 Regards, Michael