From owner-freebsd-current@freebsd.org Mon Oct 22 22:00:12 2018 Return-Path: Delivered-To: freebsd-current@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 CF8C4FD8AA2 for ; Mon, 22 Oct 2018 22:00:11 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-qb1can01on062b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5c::62b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 663FE766CD; Mon, 22 Oct 2018 22:00:11 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM (52.132.50.155) by YTOPR0101MB1017.CANPRD01.PROD.OUTLOOK.COM (52.132.47.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.29; Mon, 22 Oct 2018 21:59:52 +0000 Received: from YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM ([fe80::b09c:c689:9517:ea2b]) by YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM ([fe80::b09c:c689:9517:ea2b%4]) with mapi id 15.20.1250.028; Mon, 22 Oct 2018 21:59:52 +0000 From: Rick Macklem To: Brooks Davis CC: FreeBSD Current , Josh Paetzel Subject: Re: which way to update export_args structure? Thread-Topic: which way to update export_args structure? Thread-Index: AQHUWq0WJEV5v0B9NEODb8Fv+fAB/qUNrJCAgAZGIdGAAanmAIAR0AV4gAQgCwCAAFONFoAADjq0 Date: Mon, 22 Oct 2018 21:59:52 +0000 Message-ID: References: <20181003155133.GA57729@spindle.one-eyed-alien.net> <20181008170428.GB9766@spindle.one-eyed-alien.net> , <20181022160508.GB45769@spindle.one-eyed-alien.net>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB1017; 6:HO5cH8VEE4Jx6123tKoz1Njl1oqTr/UmVg772r3oLSUXogiAnRy+7sn8r9QsAvuDik3U3DpOScbhBZwkSiH6KlUN1u7fVGjcD4lyJe6cujobbUkHp8xP7u+lPpo4c4JkhIZzX5CJglTCspelRyBFnR2Gw5LhXW3hWV5I1TDBNEGZPqVCfWhG/EmZ6pqof6xSKHo9z4PK40xFOFBCD7JlepRsvsjefeyhK1qdCOmLhz2ii5b+yOtWfwTTgQr8lxy1sz90Slwm2jPcRxxhVKXobO4jg7wqb9L7h4TBgDT9PJMqsmr6bOSo1v6/gwbiKPjnsznQDeD5ym8clLhZ82wyfsLOc+/CC1xwoernUAZWXaLfB/DMm0KPobPR2e/BzuNfj57dprgJ0Lj/G21axXFafdCljTCx3u1NInwFRMtR7yrYOS9IDLXt9mxNqTeOTnSrdCMnatzRbuUuMi7g7qxFbA==; 5:kPVzeDNDkvIb+6juMEQ69kLedVXAmQv+iTdLZNhh0aoJNznPKPOfXftaD0KZM1Tpc00duJj++BM/demHtB0yNnk095UIAkA9KnV+rM701vONC0qbkAXf8iwalCiEzu+0wHa69/w4oZRbrBbDE7soMBrq1dcPBAE0OZHe8YuGERk=; 7:DK8EC8a1Q/vkYPi5TV+uqcJtBB70wOYALLKyrAmNQxFaglFXnd9nr3kdMyKC+VX2bfy7x+SjTVwOpRH8d6/jX3v5ZNAj6ri8aFNNp3Zl9P3d79I49KZg8HXH0SpopFKyh5emHnLFK23JGdxDz+iASyCoQiTfQBN4SJfXtsoH+5vsJStDuUNHaoQkXXrtiwqimNQ8XfC3nZcZHdutCY29k8A4ruVpK75PYPvL7hFEhCxo0T5VHIiLYfSCakxpZv2f x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 913c07ea-99e1-43bd-4cec-08d63869b1c2 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB1017; x-ms-traffictypediagnostic: YTOPR0101MB1017: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089)(18154293887054); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:YTOPR0101MB1017; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB1017; x-forefront-prvs: 08331F819E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(136003)(396003)(376002)(346002)(189003)(199004)(256004)(186003)(86362001)(9686003)(486006)(6246003)(76176011)(93886005)(229853002)(46003)(5250100002)(15650500001)(8676002)(14444005)(6506007)(6916009)(5660300001)(25786009)(97736004)(71190400001)(71200400001)(33656002)(93156006)(2906002)(74482002)(305945005)(68736007)(4326008)(478600001)(106356001)(105586002)(53936002)(99286004)(81156014)(55016002)(81166006)(786003)(54906003)(316002)(2900100001)(446003)(8936002)(11346002)(6436002)(7696005)(476003)(14454004)(74316002)(53546011)(2940100002)(102836004)(586874002)(43043002); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB1017; H:YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: +bhQwQDXHidIpAZKu9Gj4sVqpEntrAYZ+7Y1miJRvEd/5T09LNJXD0B28QGQoAgQkhrLGzwBCHhvaIuqXzpeTeRGkYPukesk06r9UgYicPVPF5Fnak0g6AkeUhW/k/P/2TtlmFE3O3oYsRps9H4UUif5G2KwGmYaWhN4KkLh8gSbAGFt8xJbnKkmJxsANVtXx8RwvuC5kKF+QrC9kWphEIk26f0Lq5STZuvxoW+6sP7WWosAAZowg3mo8XwzKVZhfsDXQ7CXyoDUB2RpgqpGfvoKalDw6JtGBX/vLYZgXx6gZq4OSLwVMiwX2SAph1Ut+WnNi9UOpcIbPVXC5NRKwfNuSjgIfKfmYIgcZyKpaEc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 913c07ea-99e1-43bd-4cec-08d63869b1c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 21:59:52.3588 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB1017 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 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: Mon, 22 Oct 2018 22:00:12 -0000 ________________________________________ From: owner-freebsd-current@freebsd.org = on behalf of Rick Macklem Sent: Monday, October 22, 2018 5:24 PM To: Brooks Davis Cc: FreeBSD Current; Josh Paetzel Subject: Re: which way to update export_args structure? Brooks Davis wrote: On Sat, Oct 20, 2018 at 01:17:37AM +0000, Rick Macklem wrote: [lots of stuff snipped] >> + if (vfs_getopt(mp->mnt_optnew, "export", &bufp, &len) =3D= =3D 0) { >> + /* Assume that there is only 1 ABI for each length= . */ >> + switch (len) { >> + case (sizeof(struct oexport_args)): >> + case (sizeof(struct o2export_args)): ... >> + memset(&o2export, 0, sizeof(o2export)); > >This is certainly redundant given that you immediately copy over it. Actually, I just looked and this code is correct. The trick is that "len" m= ight equal sizeof(struct oexport_args) which is < sizeof(struct o2export_args). As such, the memcpy() may only replace the first fields of "struct o2export= _args". I've added a comment to the patch to clarify this. rick