From nobody Wed Sep 20 20:41:45 2023 X-Original-To: bugs@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 4RrVnQ1Vbjz4v87T for ; Wed, 20 Sep 2023 20:41:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RrVnQ0SgVz4KZR for ; Wed, 20 Sep 2023 20:41:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695242506; a=rsa-sha256; cv=none; b=cXETGsyVfN8W+bbBdfV3vLwuir3vhSCGAplIzGQH0BwnchdbDww8LZM0TsgeKZJWpU4LNq +jPdknEvwhnVkcap5eAqJC6xZ+rirO2v3Mwu6tcFLiFv+zLn8I6vEXoO2J0EPTlX1TKAos i3xrfQ4ucz3pt+cwsfyU1TtwFE4f146SUEtSduFdyGVQf4mc3po88zHwfungQCimXH7gTT io0My32TOHnTmdTVWRsB88KLCqE00rhizVxiVcAEx5S4ye6V5gTSjQ68MZUARMFXUtttT+ qL56neLzg8+K13vdmfwv06gz32fuUPgulGFP+ZuNZm7xnpzOq8Vt9VNc7JSFgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695242506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M0oMwthrRl4HD9L1USGFz+ZSTB4VL/j7j9oGtL7+s1M=; b=cKhGoKM3fpuBNFA2YPYs+2ctBNEqSmsSLcsqVjt9vdwbpJXsmRd9fjeujMCmwFevYTPwTA LKShtS17+pj8asHK95l4CNmqICQrXL2i7h0j7gbfxyQSbso/a9UE5GS2LontAQOy1Mji+b G2HW1sxL+5RyjO9iliXjcSfYQf6JvgGBynBQeoxUmiY/Xyobot0EqY3F9CF06Ld7QPRZFX BE9FjbjxTnMgNbUCki3A7krauZ1W5pX1Zs9xzCi4b5AF7DHQQ5cKfvbTfYhVIv623B8EKm JWeaf04TBeHTE2sp8T5rr0S8uqpbGuug/5Obw/mcVvcULc6NGYKwX+SMAPCFOw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RrVnP6Y5xz18cp for ; Wed, 20 Sep 2023 20:41:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 38KKfj3r071166 for ; Wed, 20 Sep 2023 20:41:45 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 38KKfjeM071165 for bugs@FreeBSD.org; Wed, 20 Sep 2023 20:41:45 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 273962] copy_file_range does not work on shared memory objects Date: Wed, 20 Sep 2023 20:41:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Documentation X-Bugzilla-Component: Manual Pages X-Bugzilla-Version: Latest X-Bugzilla-Keywords: needs-patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rmacklem@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273962 --- Comment #4 from Rick Macklem --- Long ago when I first worked on 6th edition (late 1970s) there was the "everything was a file" philosophy. However, things like shared emeory did not exist. The fact that the code does not use vnodes suggests they are not files to me. Right now the code (including vn_generic_copy_file_range() which is the fallback) uses vnodes. (The error is actually returned because there is no vnode associated with the file descriptor.) To do this would require a separate chunk of code directly under the syscall to do the copying. A simple loop doing shm_read()/shm_write() should work, I'd guess (but it will need to be done as a special case when there are no vnodes) and needs to check for "no overlapping region", since that is part of the syscall interface. The original intent of copy_file_range(2) was to enable file systems to optimize copying, such as NFSv4 doing the copy locally in the NFS server instead of reading data to the client and writing it back to the server. (The fallback was implemented to simplify the case where the file system does not have a specific VOP_COPY_FILE_RANGE().) Since this case is not file system related, the above does not really apply. (I suppose do so saves a few syscalls.) I will ask on freebsd-fs@ to see if others feel this capability is needed. Feel free to come up with a patch. If others do not, I may do so someday. (It would be called from kern_copy_file_range() when f_vnode =3D=3D NULL.) --=20 You are receiving this mail because: You are the assignee for the bug.=