From owner-freebsd-current@freebsd.org Wed Oct 3 00:40:30 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 3D72510B278C for ; Wed, 3 Oct 2018 00:40:30 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670042.outbound.protection.outlook.com [40.107.67.42]) (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 D6CEF8371C for ; Wed, 3 Oct 2018 00:40:29 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM (52.132.44.160) by YTOPR0101MB0778.CANPRD01.PROD.OUTLOOK.COM (52.132.44.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.23; Wed, 3 Oct 2018 00:40:27 +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 00:40:27 +0000 From: Rick Macklem To: "freebsd-current@FreeBSD.org" CC: Josh Paetzel Subject: which way to update export_args structure? Thread-Topic: which way to update export_args structure? Thread-Index: AQHUWq0WJEV5v0B9NEODb8Fv+fAB/g== Date: Wed, 3 Oct 2018 00:40:27 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; YTOPR0101MB0778; 6:2zHLSDiLC5DMY8mWQ/+EqbIDp9d40yAtTHG3l6VFYXsHF+Ok+cq7RA85i+y0pCPvB9GXC0Pkg4dLFsUjDVBdtcFS9QoHC8OZe9DWe3qmjlP93jUzu/jjXyDANGqsenViEjiqIZ+Hz25VXcv2Yp+BjSFf3jpzdoE9BKv3xdXl4emsdeJxbyeTVJbsvQwsqrJOJrbtSJ7BQ32M+hUqe1eLdFfmihJx+yb/7SJaJyTb0ncB/dkAq5tCWvj1gR8lmQJTo6Wu+3AO68mfCg0MLp8glGMneC6bHVrMiZhoD4J+H18MNhyx9UhMUlptH1caawDCX1RDcHrr9IcvTOwR1aKnYgsEZyakT9IWqs/dWBQjEk1AaTOEXSgc/DYltmp1oP1kiUO2quwkx17FNsP6iA2ohowFOzLELIrPXYqmqNg5zBGMbnX1RoB0/JBcKqEtJKp49wKps8kBBAryN8X/+CSOYA==; 5:kyLBOsQ4qNxlUsZQg5+cu4vUYEkAYnkUXoy/ac4DOltERB7G/+PPJV1LaOaaRRZpMyJEeYZdMSgS3v0ABujYDNgMrio+9TccyiiDBlTVgiQPvDlScEjCBEScSqo7E2Rs9Q4yRvYmc+WcuNM4lx889IerzGRkVfe0vS49Cxqaop4=; 7:ht92rLNEAFB87uX0xQBveuymuLEnNa9TgJvaeF+Bex1ysqLW08NOAwEFaUMHNUR9R8o+ACk21dkJvn8QsdoAfKTqWWi81X3yg0x9DPk9maGTd1qYPg1/1cQTqxgg95LAB9v4qKc74AISRUbxQwzQuAMAIYHxI2/NXOcbmeIF+i2f3VCB6qdgVy+nGzaA3bnfhqsh9Ot/Ndov3MPInM+blLa9YzNNVVmj7FwC0hDCvnTznxlfbh49k/XgD92VWpKi x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 89304d63-57ee-42ab-d8f7-08d628c8d097 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:YTOPR0101MB0778; x-ms-traffictypediagnostic: YTOPR0101MB0778: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(192374486261705); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991048); SRVR:YTOPR0101MB0778; BCL:0; PCL:0; RULEID:; SRVR:YTOPR0101MB0778; x-forefront-prvs: 0814A2C7A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(376002)(136003)(346002)(396003)(189003)(199004)(102836004)(106356001)(7696005)(68736007)(256004)(14444005)(8936002)(15650500001)(71200400001)(6916009)(105586002)(71190400001)(316002)(2351001)(5250100002)(186003)(86362001)(14454004)(305945005)(2501003)(4326008)(2906002)(97736004)(9686003)(99286004)(25786009)(6436002)(476003)(786003)(8676002)(33656002)(5640700003)(478600001)(6506007)(5660300001)(2900100001)(55016002)(46003)(74482002)(74316002)(53936002)(81156014)(81166006)(486006)(43043002); DIR:OUT; SFP:1101; SCL:1; SRVR:YTOPR0101MB0778; H:YTOPR0101MB1820.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: MfzsQtU5cMo9SGKodhO3C0dIh/zykBbqHk3fedRK8Adlu1N9jVOyVwvdaBh4fKp0ZCpyhwY+fn9GIPInJX2+dEIim62JpCqzHdf8jxsjsksTFwMDaL8XSA7HSs0YdKFPXUaFUNpEW/tZ5ayGULaOPUocctgBqVqhcYe7tjj8D29xv/rF7vByW0Vhm59g8Lg+o2av18rFUSVmKY34kToQeYEx+PSH7cDlXQYJSfrBO0Xh+Fb9kgveIFrKI5RhrFmXI08+xchxQGlHF9V9jIDiH40NfGfxEeMe2IS4aH5Pv1kEr45STkL40n11IfiwVMwOElk12UbiRWz9pciiOvN+6ggDh3287tXbh2E8c15uhA8= 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: 89304d63-57ee-42ab-d8f7-08d628c8d097 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2018 00:40:27.7217 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB0778 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 00:40:30 -0000 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 mou= nt.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 addr= essed 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_flags64 */ 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_flags64 */ 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;-). B) doesn't change any fields, but adds a second ex_flagshighbits for the hi= gh order bit. Since it only adds fields where none of those bits are used afte= r 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 confusi= ng to have the two ex_flags fields for the low and high 32bits. So, which do you think it preferable? rick ps: Josh Paetzel has volunteered to do the mountd.c changes and I have a ke= rne patch that I'll put up on phabricator once Josh has been able to test= it.