From owner-freebsd-current@freebsd.org Wed Oct 3 01:03:56 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 0B2D510B31BA for ; Wed, 3 Oct 2018 01:03:56 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670069.outbound.protection.outlook.com [40.107.67.69]) (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 8604A843E9 for ; Wed, 3 Oct 2018 01:03:55 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM (52.132.44.160) by YTOPR0101MB1673.CANPRD01.PROD.OUTLOOK.COM (52.132.45.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.22; Wed, 3 Oct 2018 01:03:54 +0000 Received: from YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM ([fe80::65af:417a:161f:f4eb]) by YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM ([fe80::65af:417a:161f:f4eb%2]) with mapi id 15.20.1164.029; Wed, 3 Oct 2018 01:03:54 +0000 From: Rick Macklem To: "freebsd-current@FreeBSD.org" CC: Josh Paetzel Subject: Re: which way to update export_args structure? Thread-Topic: which way to update export_args structure? Thread-Index: AQHUWq0WJEV5v0B9NEODb8Fv+fAB/qUMstir Date: Wed, 3 Oct 2018 01:03:54 +0000 Message-ID: References: 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; YTOPR0101MB1673; 6:nGsUEttdIx8PIkq65rJjMU8nP/x7R8aS7je6MntPugfLwphvl03u+xwn/WcxqD82+7f26awsWyfo1cNPp0CUdx1REowrkLMgLLLkCzwhQ/HKSkjvGNsLWZqTkWM+CjokIKGa1lHUBlvuUeoSVodDmYEZ7QiXMbZvb6QTCbfOvHYK9+GC2zE7Q1VOKuSQ5vxkMTAd4VtyUrQxTPkdOL1mkfmHHRgidHIAaR9OgdBUyFRc3GwFMdJli4GwufbKB3lh/DbSS1UFIodwZhFUzAFKi49QxUNjj0rkvQKRXKXp5AjaYh9rvMHrsWhl6JF8tQ9X451XAzXXN3JWVmQB919vmoau+cp+O3gKdZzM0cP/Ox4h97Ear4uobTYNtUKMxKsnRWHCoZcLBnWDrsiNVQtH15yOFuGslOISXD8YxbvIGurNRXhfHeuMOmFG5fB5qWH4ck5LQaeAZLE6E4cERPD84A==; 5:z1WpiR9cT3j+D/WaqbRx3C8qXFg1205U0dGQO1JdsGr7Idi2s0NXiMusOIxCDqTsOKEbZwa9F5GBOJ8xNBpA+JWoIR8ispimOA/op+VPY0bzueER/pkZq9LoQhmd8VXlz2cD04PFsG2G4mNFr7TyC4iB3jMxyHHQOueyMSuyw4A=; 7:tvwVEHxSo/FulkgEvH2z7dq+/NriJ+B+Razf2fC0Whoaw67/QpVnTPK+qkLI7RRc0PBVE8TK0g7mann4DhS3myrUTO9UEGqdZw1CALpICUZpqdNqL9KeRO4pHkcQYoCw7F/AwwwDtMdhKgCmTeWnRRAxkXgjmgfBICR9rmMvcdQX5L/yX6YWTLCZeeNqPrnRv74iAytpT9hy/VkKm5A4lm6bOkgpx4Ayb0E5a3yojdT5pJ7Q2Ne1t/HyTLsWzNW9 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 73c62918-e24f-4b09-190d-08d628cc16df x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB1673; x-ms-traffictypediagnostic: YTOPR0101MB1673: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(192374486261705)(75325880899374); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(10201501046)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991048); SRVR:YTOPR0101MB1673; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB1673; x-forefront-prvs: 0814A2C7A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(396003)(376002)(136003)(366004)(199004)(189003)(478600001)(2351001)(2900100001)(15650500001)(71190400001)(93156006)(97736004)(4326008)(68736007)(6246003)(2940100002)(71200400001)(106356001)(229853002)(2501003)(5250100002)(966005)(53936002)(74482002)(476003)(486006)(11346002)(9686003)(55016002)(446003)(14454004)(7696005)(105586002)(6916009)(76176011)(6506007)(5640700003)(99286004)(5660300001)(186003)(6436002)(8936002)(2906002)(102836004)(33656002)(8676002)(86362001)(81166006)(6306002)(46003)(74316002)(786003)(81156014)(305945005)(256004)(316002)(25786009)(14444005)(43043002); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB1673; H:YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-microsoft-antispam-message-info: GeAvg1LGHcIOqt1aYZnE4ygleWgv5g2wEXFX7z7SjVNcmX/puE2RQOMaZmWw7Gcefo9UYhJ8NjzQQfzXLV0VSr983Lq+lc1QCAWlm9N2kldTyp/oaz6p6diGtKEl0Xnw4gPwXY5419xFvGYrQ9QnreTJQG7Zs3DJ3h2Rc/q7BVHkrcTf3Ph8j0XogDTRePPSjVsQImoLdQLcBCLh0OuPmoQtC65UAcqEtECwhYUW5TnIWI1oIJ5j3SkbgUsS/0PUcbrYgpsoOcSTPFuqFAw8UWvkZFGDkpG/fqyQ2pE9U1QcfWUdPc4NGlSl4KI8kZFtAGHCVcpvr2IZWy67x6WFbzOHBkNpdDMN2jwjDYqRkZs= 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: 73c62918-e24f-4b09-190d-08d628cc16df X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2018 01:03:54.1194 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB1673 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 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: Wed, 03 Oct 2018 01:03:56 -0000 I wrote: >Hi, > >I am working on updating "struct export_args" to fix/add a few things. >One of these is that "ex_flags" is an int, but the flags are defined in mo= unt.h >as MNT_xx bits that now exceed 32bits (mnt_flag is now uint64_t). >For now, this doesn't break anything, since the flags used by ex_flags are >all defined in the low order 32bits but...it seems like this should be add= ressed >by a new version of "struct export_args". > >I have two versions of the updated structure: >A) >struct export_args { > uint64_t ex_flags; /* export related flags */ > uid_t ex_root; /* mapping for root uid */ > struct xucred ex_anon; /* mapping for anonymous user */ > struct sockaddr *ex_addr; /* net address to which exported *= / > u_char ex_addrlen; /* and the net address length */ > struct sockaddr *ex_mask; /* mask of valid bits in saddr */ > u_char ex_masklen; /* and the smask length */ > char *ex_indexfile; /* index file for WebNFS URLs */ > int ex_numsecflavors; /* security flavor count */ > int ex_secflavors[MAXSECFLAVORS]; /* list of security flavors = */ > int32_t ex_fsid; /* mnt_stat.f_fsid.val[0] if */ > /* MNT_EXPORTFSID set in ex_flags6= 4 */ > gid_t *ex_suppgroups; /* Supplemental groups if */ > /* ex_anon.cr_ngroups > XU_NGROUPS= */ >}; >B) >struct export_args { > int ex_flags; /* export related flags */ > uid_t ex_root; /* mapping for root uid */ > struct xucred ex_anon; /* mapping for anonymous user */ > struct sockaddr *ex_addr; /* net address to which exported *= / > u_char ex_addrlen; /* and the net address length */ > struct sockaddr *ex_mask; /* mask of valid bits in saddr */ > u_char ex_masklen; /* and the smask length */ > char *ex_indexfile; /* index file for WebNFS URLs */ > int ex_numsecflavors; /* security flavor count */ > int ex_secflavors[MAXSECFLAVORS]; /* list of security flavors = */ > uint64_t ex_flagshighbits; /* High order bits of mnt_flag */ > int32_t ex_fsid; /* mnt_stat.f_fsid.val[0] if */ > /* MNT_EXPORTFSID set in ex_flags6= 4 */ > gid_t *ex_suppgroups; /* Supplemental groups if */ > /* ex_anon.cr_ngroups > XU_NGROUPS= */ >}; > >A) does the obvious thing. Unfortunately, this changes the vfs KABI >(specifically the function vfs_oexport_conv()) such that a file system >module compiled with an unpatched mount.h could crash a patched system. >As such, I think it couldn't be MFC'd and would be stuck in head/current >until FreeBSD13 (or FreeBSD14 if 13 gets skipped over;-). I think I have now figured out a way to fix vfs_oexport_conv() so that it c= an be MFC'd. >B) doesn't change any fields, but adds a second ex_flagshighbits for the h= igh >order bit. Since it only adds fields where none of those bits are used aft= er >the exports are processed by vfs_export() and, as such, will not break >the VFS KABI, since vfs_domount_update() differentiates which version >of export_args is being used. >As such, I believe this version can be MFC'd. However, it does seem confus= ing >to have the two ex_flags fields for the low and high 32bits. No longer an advantage, since I have figured out how to handle A) so that i= t can be MFC'd too. >So, which do you think it preferable? rick >ps: Josh Paetzel has volunteered to do the mountd.c changes and I have a k= erne > patch that I'll put up on phabricator once Josh has been able to tes= t it. I'd still like to hear any opinions w.r.t. which is better? rick _______________________________________________ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"