From nobody Wed Sep 20 23:54:01 2023 X-Original-To: freebsd-fs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rrb3P4Z9Yz4vLfR for ; Wed, 20 Sep 2023 23:54:09 +0000 (UTC) (envelope-from jfc@mit.edu) Received: from outgoing-exchange-3.mit.edu (outgoing-exchange-3.mit.edu [18.9.28.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.outgoing-exchange.mit.edu", Issuer "InCommon RSA Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rrb3N1qYcz4gVq for ; Wed, 20 Sep 2023 23:54:08 +0000 (UTC) (envelope-from jfc@mit.edu) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=mit.edu header.s=outgoing header.b=m9Glx1Kf; spf=pass (mx1.freebsd.org: domain of jfc@mit.edu designates 18.9.28.13 as permitted sender) smtp.mailfrom=jfc@mit.edu; dmarc=pass (policy=none) header.from=mit.edu Received: from oc11exedge2.exchange.mit.edu (OC11EXEDGE2.EXCHANGE.MIT.EDU [18.9.3.18]) by outgoing-exchange-3.mit.edu (8.14.7/8.12.4) with ESMTP id 38KNs4aa005880; Wed, 20 Sep 2023 19:54:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1695254045; bh=IVJt3E3KfWKux1bpkwj/vVmMEweHyo3K0XsGdWObi5E=; h=From:Subject:Date:Message-ID:Content-Type:MIME-Version; b=m9Glx1KfOryE0T8BVT6MVxjC1NJ+DTV8wFWlKWnCUmKzKDlMhnMZWworNQrTyv/Xk yhFRnwCA84CSxEDY3bgzUUShLqy2ThOA3TJV8pv1Z4a6CScmqXEXuD0+QJrNw3ps9f M2+irpNTxXm5MKMpYKU+GZBPWhozYPnSL19kJAVJFxUUe2LQUFRE8OIF53RM/Bp9cE nzY5hnm46/mfHZdP3ogrHLJIBa8vj72YKhEkyUFdTXywBF2lLeQMRO4Y01+b5eRjto lnonyMLvLww2saPvX0dG7EGyO5S0Oo5P6L3svXNmj+ZEL43lZGtc22iwMifbWy6mNs QiXF3aY4VxkFg== Received: from oc11expo11.exchange.mit.edu (18.9.4.16) by oc11exedge2.exchange.mit.edu (18.9.3.18) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 20 Sep 2023 19:53:55 -0400 Received: from oc11exhyb4.exchange.mit.edu (18.9.1.100) by oc11expo11.exchange.mit.edu (18.9.4.16) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 20 Sep 2023 19:54:03 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.46) by oc11exhyb4.exchange.mit.edu (18.9.1.100) with Microsoft SMTP Server (TLS) id 15.0.1497.48 via Frontend Transport; Wed, 20 Sep 2023 19:54:03 -0400 Received: from SA3PR01MB8450.prod.exchangelabs.com (2603:10b6:806:382::17) by DS0PR01MB8004.prod.exchangelabs.com (2603:10b6:8:145::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Wed, 20 Sep 2023 23:54:02 +0000 Received: from SA3PR01MB8450.prod.exchangelabs.com ([fe80::ee32:19a8:b83e:efbf]) by SA3PR01MB8450.prod.exchangelabs.com ([fe80::ee32:19a8:b83e:efbf%7]) with mapi id 15.20.6813.018; Wed, 20 Sep 2023 23:54:01 +0000 From: "John F Carr" To: Rick Macklem CC: Freebsd fs Subject: Re: RFC: Should copy_file_range(2) work for shared memory objects? Thread-Topic: RFC: Should copy_file_range(2) work for shared memory objects? Thread-Index: AQHZ7AO5tx62EIf6Uki/4rnO3/jzpbAkY2AA Date: Wed, 20 Sep 2023 23:54:01 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA3PR01MB8450:EE_|DS0PR01MB8004:EE_ x-ms-office365-filtering-correlation-id: 9a6dfa8e-f79d-497e-e57d-08dbba34dd27 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LokNj+R+DhhaEgPGz2IsMdMjO+cSaMd/5UhF5VMjfJeXuDI4rY+56RbZX3qiS/m+9Wjp4hNLHkL0R+n3ir1PfSV3rkyR9t6U25ecxrXL0UPaKUnReabXCvFbRK2zC6rUdugKbDbX4BSo4sxZjiWYjIc+nHvT1iyJ59Z8OAt/Y2R5AvwToewiBrBXstWGNq68Bb7ZzthDSWsjqW2+kAbWNtC8q8Ht/1o6thP8sYkGlh047aKuQjLCyh1T9SROyvL8cl/V8nAkSbPk7JodsaqlTJjGnjz2vu8baA3yEYgSUlHzX6DNwT0wNMU4EBPOiDGftShs7UdmYr3LfjH5zq9JIkv77s6mjAj4RHUUNY7cNEnWDLtcmTeqL/ZhC77MTX1xTLvWt67BrqrzOMpqNKTeUf0UQpDxWrU8YSsM0Zxzs2pospAb0fwZdU8PpYecfTrHWZbIcuueaFDprQmrydB1voimHBtWfVw9Ei+awF2uVzvx4O1SqJdofb9bSZMzriod/OYYnrSBjfKxO0DfLvRjqfn1kioTzwWf2dSiFGHQY9eAzNN5rW1rqoTmzSZnZ89NLsJ57yhVjWsP4AQbm8hNMO01pEY6xZDFAfF3HAX1ULEJvCRJEgqJst35djap7tqJ x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA3PR01MB8450.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(366004)(396003)(39860400002)(136003)(451199024)(186009)(1800799009)(2616005)(4326008)(8936002)(41300700001)(5660300002)(8676002)(6512007)(6486002)(6506007)(26005)(53546011)(83380400001)(478600001)(71200400001)(316002)(786003)(6916009)(75432002)(122000001)(66556008)(66476007)(64756008)(66446008)(76116006)(66946007)(91956017)(86362001)(36756003)(33656002)(2906002)(38100700002)(38070700005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?njTjTjZOKDdgx72h7hyydJYjwFlgT30u9xHEPJNxqkiR5SCVcXVcPtIk82ao?= =?us-ascii?Q?5fMkfiKM4XF3LiCjazul2xzoX2Y7q8rJ4Yq32f6/E0vCY4Yd8bxALA9y450m?= =?us-ascii?Q?Aig3cQAkUKtgE+Pt7sh5it/j7tWUbHTDkGsgEsCeZAnDNgkGgLhQQWhMdOZy?= =?us-ascii?Q?rUskPyP7ulIk235VQYamJl4hUiF5oBXveIj1iviMtvD92S+fj+j4b0LPGWZD?= =?us-ascii?Q?oc66GFwD2jZP1ImbPFw7yA6TZ+G74ewltdBuTzPT39FLB9ilgLMAKzJnB7cl?= =?us-ascii?Q?Td3Sxc8Auqy2RTK0eXnP1wBAMBVaMJ/qN9E77H0Dizl3/haaC9wXG1G5lyzS?= =?us-ascii?Q?ZK/B+ZwWWzfZVfz5iNnvS4x6cT3pOPdMWGtjluu6Kt6ozssmNdLDAGB2kOLd?= =?us-ascii?Q?/k5EuCFv0leS+yfu2oju+futpXDU0dPdKRFgWiB3NGmYECG0SLnkF/jZBzb9?= =?us-ascii?Q?Py6OIs+ub9d3Q1/0Cjk4sNnmYfQVeDZr+yMe6qodhCJ/EpLYeqrAz6D42UUx?= =?us-ascii?Q?GLhc+Igv/RUYDxkEasSfxUKlWyUjvMqHZQ+xASUoTQ9V/0399mrBB5J46VO2?= =?us-ascii?Q?b262KfcwUhcSqzUDSPc8ZCGoWHSPXdTN+f8ijhInnDVBao4/Pp0YgFXZ7hKl?= =?us-ascii?Q?+UweOpBL9oEK2B58L19Eoj37nFaxDjM55a+oyBb/RRQoIiW7ErMqZVV4fjsM?= =?us-ascii?Q?kiII9ntiJ4ffKsZ3SjpIcKgvqlAf26iDH+aqQhEE8bqY8U4MsxOSpCmA+e0H?= =?us-ascii?Q?J5TerilBWEDGzEvl+y04+BlBW0FC4vdck8zLJn9tFnH2yLEEHXdWCKl0LbuB?= =?us-ascii?Q?54+RAJrI39AXBsHbKgcg3C8BcOSGjxa2gdXUXsysuw39LD8VZcGFXmFs9bas?= =?us-ascii?Q?Ggl70LIkb6WPT+wUXdtKW1WFEaj7RlIly+uGpLiVQUYVKklZeBE5TWckRXzR?= =?us-ascii?Q?NTB//5xLdzwO1Y9eTF2bGYEJIdNrTPH5Lqd0StLw1G1F/C/EkpOwLN4cW8jR?= =?us-ascii?Q?jJVfpQnJaosaMI4vmFqQsssRU5SO8eaygvX9ecf4I9ea5YT3muhpVjiFQOZe?= =?us-ascii?Q?0zWyv1QZ4liIUjC2eDkvC34L13tHEHcungZctdxGoZh1fLtr+vGp2GQZySxn?= =?us-ascii?Q?+cuoEPgRCrq/Dyd6zzXBKP0sUfg+F+QYEdM/hr8w3iohvXEEK12MGuWt83aB?= =?us-ascii?Q?6i0B7eG1vhJR3pCrdDdkx8p3Rju93GVxQQ1qCBMUPW/KXbnZ+V+dgTaDm1/8?= =?us-ascii?Q?1g/B2tH9d1xdm1snt9iSnG/MVbVG0axkO1m/SUTqdH/bhOiiEzjy9rnNAju7?= =?us-ascii?Q?WcxWWnN3VgaumXjJzomXaTqpkL8omkm9qXuR5Pcop+DBoLe6II8IZRMx2KpU?= =?us-ascii?Q?ceFk2OFHteHuGbd3VhBhNaj90Fja52FXlGJls348KFcJH5zuh6AKwbNxrVcH?= =?us-ascii?Q?+VXkteBb2/RawXzr81bPJm6uTOHoZQ4xPes8+ouw/p6rYvg7fcS2fb8MasAj?= =?us-ascii?Q?X/NIqcP1E8JPsyifAJVal8csWvqAlqJlTZiAJhg6adJVb/JJXsl9PZnr7ORQ?= =?us-ascii?Q?aoxXroO5+lExTGG6zfM=3D?= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA3PR01MB8450.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a6dfa8e-f79d-497e-e57d-08dbba34dd27 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2023 23:54:01.4291 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 64afd9ba-0ecf-4acf-bc36-935f6235ba8b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qan+OzyAHrnx3Gzt9PFa0Uu9tb5ytyT0va1Q+3RlFiteZG+Qx8z3k5peqZWAbOVr X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR01MB8004 X-OriginatorOrg: mit.edu X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.90 / 15.00]; DWL_DNSWL_LOW(-1.00)[mit.edu:dkim]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.996]; DMARC_POLICY_ALLOW(-0.50)[mit.edu,none]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCVD_IN_DNSWL_MED(-0.40)[18.9.28.13:from,18.9.3.18:received]; R_DKIM_ALLOW(-0.20)[mit.edu:s=outgoing]; R_SPF_ALLOW(-0.20)[+ip4:18.9.28.0/24]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[104.47.51.46:received]; DKIM_TRACE(0.00)[mit.edu:+]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_ALL(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:3, ipnet:18.9.0.0/16, country:US]; MLMMJ_DEST(0.00)[freebsd-fs@freebsd.org] X-Rspamd-Queue-Id: 4Rrb3N1qYcz4gVq On Sep 20, 2023, at 16:47, Rick Macklem wrote: >=20 > Right now (as noted by PR#273962) copy_file_range(2) > fails for shared memory objects because there is no > vnode (f_vnode =3D=3D NULL) for them and the code uses > vnodes (including a file system specific VOP_COPY_FILE_RANGE(9)). >=20 > Do you think copy_file_range(2) should work for shared memory objects? >=20 > This would require specific handling in kern_copy_file_range() > to work. I do not think the patch would be a lot of work, but > I am not familiar with the f_ops and shared memory code. >=20 > rick >=20 According to a Linux man page, some failure modes are EINVAL Either fd_in or fd_out is not a regular file. EOPNOTSUPP (since Linux 5.19) The filesystem does not support this o= peration. EXDEV (since Linux 5.19) The files referred to by fd_in and fd_out are not on the same filesystem, and the source and target filesystems are not of the same type, or do not support cross-filesystem copy. According to the FreeBSD man page The copy_file_range() system call is expected to be compatible with th= e Linux system call of the same name.