From nobody Thu Sep 21 00:39:05 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 4Rrc3V4csyz4vNvY for ; Thu, 21 Sep 2023 00:39:18 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rrc3T6v6vz4kG5 for ; Thu, 21 Sep 2023 00:39:17 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-274939681b5so241402a91.0 for ; Wed, 20 Sep 2023 17:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695256756; x=1695861556; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=HuX1XTdJTxywbnxtkjESZdh7GrdCEvvWnFzH1gZ63Ks=; b=JC40m9tX0S2GtHca7ZVNxJPhqhAlvvj8Quvf0rStv5v2+k64udympAHEtIR8XJKUyT 160xF5VYk+4XXP1YoS1H6plsXksDGxHWI5mL7DCB1XU5ez6EUBj759ASNNuHrT99o8Ub NRsYJxwpA5NSrKfnY4P+mRIQQ2iyeVyBBxZvyG1pEXOMf7OoaxyKxgu6fgQhBE6fW16X FPpRf2tJJPIBwBaosN8KDl+dygMTolCtwGQ+KG0+ZkMEvUeWOQ/ZDzACeVkeJ65/3Nov RQyT9psYJ3H04X6DsO5X24qYW7CxQRezt2nWS3HlaijZjRqmDQ7zwbEy5qOw4jFaSU6l xfZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695256756; x=1695861556; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HuX1XTdJTxywbnxtkjESZdh7GrdCEvvWnFzH1gZ63Ks=; b=XhVXvMwZ0pVgsVPg5vQ6aZVK7vApDivSgQDxiUvmUdgeb7+MtVszhTijCDZbclL+Y0 8rY4coeIB/hBLKBFGYnXA6JPtaBnaGnzNWHAnHsG04STmXLMHbOXiHDdfHKKywG0g+zm O2cr4XnpOgJbmK85vaZWFP22g65NuJW4ckEzfl5oiNrmm4hnc0vspYZ8V2NUUaQ7cUxw KtiKz7AO41cLWCiITCzd6YO2zmtLNx1b4O/CQ/HX9+x3Pd9/D8MhrV0LahkCnav4aL8B pQNAQ/3aUQ/1oWzcBtp5+cWVp2oxAFc3LwiwiD/2k1+6mil60jhuJyHKstjP8y6I2oLB D3+g== X-Gm-Message-State: AOJu0Yy2t1ZtsWXhRyCvtBBpPiiRVwwKAdTm/tuV9XHyV2IwDqaL0AyV m+FlVQLxPcnzU8/QuvuLA6Q47rJbHCGTbaznaw== X-Google-Smtp-Source: AGHT+IFEDtCEehXhNp/gXo5IbSwrHvvz+rLxdEMU3P9qcWqiWSnGOCN9R0VfNv3hNsC6VBPNtkPioBgSEFri28NFD8o= X-Received: by 2002:a17:90b:1490:b0:268:f45:c10a with SMTP id js16-20020a17090b149000b002680f45c10amr4177256pjb.26.1695256756559; Wed, 20 Sep 2023 17:39:16 -0700 (PDT) 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 References: In-Reply-To: From: Rick Macklem Date: Wed, 20 Sep 2023 17:39:05 -0700 Message-ID: Subject: Re: RFC: Should copy_file_range(2) work for shared memory objects? To: John F Carr Cc: Freebsd fs Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[] X-Rspamd-Queue-Id: 4Rrc3T6v6vz4kG5 On Wed, Sep 20, 2023 at 4:54=E2=80=AFPM John F Carr wrote: > > On Sep 20, 2023, at 16:47, Rick Macklem wrote: > > > > 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)). > > > > Do you think copy_file_range(2) should work for shared memory objects? > > > > 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. > > > > rick > > > > 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= operation. > > 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 = the > Linux system call of the same name. > So, I guess you are advocating for sticking with "Linux compatible"? I'm fine with that, but we'll see what others say. Thanks for your comments, rick ps; When I go look at the Linux man page, I often get an out-of-dat one, so I am never sure what Linux currently does. (It is also confusing because some distros implement copy_file_range() in their libc instead of the kernel. I think more recent Linux kernels do support the syscall.)