Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp441081rdb; Thu, 18 Jan 2024 08:02:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBhdzEhjfQig5pYhCqpQfN+Ld6MLXPBkwBnAMBeGt2qCl+NmOAigKjRunnPBCX6/9zhg4A X-Received: by 2002:a5d:45ca:0:b0:336:6e37:616a with SMTP id b10-20020a5d45ca000000b003366e37616amr288628wrs.83.1705593749333; Thu, 18 Jan 2024 08:02:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705593749; cv=pass; d=google.com; s=arc-20160816; b=RsbHLhp5KAnSDS2jLOSewyQmJOxFiwVI+I7YTRLB9/uypvE8tb1w2xwLNFnp2jyFO8 dMiV+3Ghzaz6C8Ur2ytZ8m8nPXlGcTzyl/ojawjAR7dTK1x7J1gqmC8vhsp9/SknEQVV RTyFC1ESWJn12X5I5b91wgHE8Z4SUej/PVvnPTxI2T4IoHWJet+++XvSmbP46etPMv6z qp2KMlHDfTUBd/oK4SULvI5JeGVG7shY7IGuuLilDHnOhCH6nchBHcWLe/bcoMUu75tV UvLEfd936W3Z10r+Vn3D20V9ga5myN3Pdq7e9b0QBivk8HruRb+sNK55broIL4O5pKQp uKLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Hto2SU4R3yAYwp81hj4Efa1CV18LRXcWhBAicey50VM=; fh=NqjexYcm97DROxeGX40LjxWbYxy+iX1ClvvwQYztBwk=; b=QT9W4sqbTJy4HtEwpp4eJhlUZF1LS7BtAb1p2i+BFNraM0M7ke5f6FQhEPHkDII2Wc bC9P1zB51eNvztOGUVXgrUl5hPfEOdjTMPtQoyVlyK61aq7jfw3jF/nUFWl6wbCKsjcU RpiqmGdJUPKDi2trCxHkug+ihGLLOQDqiICh9XfvgBL6hWnmdbiaBKZ7+6R/xCvQ0uf1 qXEd2qM1BnS5qsQ7m1O3NViz/CGdt2WptWFhU7tdq6wFbvyeec1uvEYTFr6jMScUffiZ qqzoK9akfws1N/d521HT9/V6ZtKZAjm7LrzaS/YYcoRULlqd0y+cq5O7byhTKcYrzdmp imUQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b="pA0p/dlO"; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-30326-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30326-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f9-20020a5d4dc9000000b00337bf2cbe18si2128678wru.590.2024.01.18.08.02.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 08:02:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30326-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b="pA0p/dlO"; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-30326-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30326-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E6F211C23130 for ; Thu, 18 Jan 2024 16:02:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD3F828E2E; Thu, 18 Jan 2024 16:02:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="pA0p/dlO" Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D93D24B40 for ; Thu, 18 Jan 2024 16:02:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705593737; cv=none; b=gSa6cvmI40w6lWi+JpX4SzcgLdIADThNme6b4m+WbKITKs9T+vEsmOD4bfYnrSd1bEJw3Rva4VdGsy+ahteDh7Bq+Ei3bCROXEf0H24WZIfxB3LF3jHPVJQCXjLwIvcZb3EDZEIJOQ4yAptCQx/I6iMe3g89VpFaMxfmQzVwhaI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705593737; c=relaxed/simple; bh=7/CWAjx5zfqKJ2XKGA+zCddsRmnknHYAn2kIAh+LnQ8=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:Content-Language: To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=OISIUNOkaYT/eJZ+qEGsy1kdxvAJPAd/anmnotxPivVBILVrOtJzwN82z5070t9rAVDCy6rtY26yJzTNt6DV0nteqPR0bY3+hxwp7CI4wU18mbPAsaGZa+1ME4fX/4yzeL1v35j0Q7qwQqHHQT/KLbTgDXGK0MBh+XmsCK0sFEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=pA0p/dlO; arc=none smtp.client-ip=209.85.166.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-35d374bebe3so9827755ab.1 for ; Thu, 18 Jan 2024 08:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1705593733; x=1706198533; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Hto2SU4R3yAYwp81hj4Efa1CV18LRXcWhBAicey50VM=; b=pA0p/dlOaP2FLSI44v0AjlgWAVOgEyKcTWu8IOUO2YH36DKCcbcsz6UKV7Jz56eAJQ lWB4G+eIglQweQQs9NCTkpgRtdD8ZWuSxRmjKxtsCZ7Z86oiv4GNkwhTarMlcOfb3ClU 5djgNM3TKg+5fx7Sbxw5+SEF+tS1FaOipUaUhYQdL19XON7Sm6iNDBzXr1TF3S1Fls/z ijvpDFaeozNURh2Z3nw8cIczsu/kFMYHAYg14q/f/TI2Utx345vvNuTqcdLOlFurjmEF m+pro5/EmM0yjCAXPROBAsYybd4VDPBU+kfEYieY+zr6QGNtC2n+WfPEEeW65/FB/mjU WvMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705593733; x=1706198533; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Hto2SU4R3yAYwp81hj4Efa1CV18LRXcWhBAicey50VM=; b=JqD3gOQrtS9ESRncnJ6y3JQtVFOZM1Hud2urwnzzvz3v4dblJCag6WvlpEaB/3o+ag uS5ufHqmhHUSAJv0HgNiO5z3NJDfsQD6qMUly0Vfb8xBI8kyNXMkEekrQ6PSaOfXGS3X 2V9pznsnL5votiJt0vP9mHo4Ii5tTvhj+UkGb2f1V3Ihhuyodj7L39pLshLO4mPhKQZ+ PATHFRM9oBkBq5W7O6ncjuS68jWJN4hIQhxVa9Pe0147/1raAc8df5E/e433uz/LmZhI N8D5uo1MSoaKrhaREh4jTjvLTIHVgXK0oODlqgO7LgF/ObQn0axynUl2j+buo+DlPq+J iJdg== X-Gm-Message-State: AOJu0YzcepE2k6gCm/Kvk/j+mfOd734GRjwzc9Aaf5Xe6hefIfA+Ourc uIn0G1e1H+yLQWoNkxvhtT+pnDnuMQuFMB4HVXDjYvSPg+EheHr1yiaOkKqX5qw= X-Received: by 2002:a05:6e02:20ef:b0:360:2a3:7e5f with SMTP id q15-20020a056e0220ef00b0036002a37e5fmr1936347ilv.2.1705593733508; Thu, 18 Jan 2024 08:02:13 -0800 (PST) Received: from [192.168.1.116] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id s11-20020a02cc8b000000b0046e7578c703sm1061800jap.21.2024.01.18.08.02.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jan 2024 08:02:12 -0800 (PST) Message-ID: Date: Thu, 18 Jan 2024 09:02:11 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] vfs: add RWF_NOAPPEND flag for pwritev2 Content-Language: en-US To: Rich Felker Cc: Jann Horn , Alexander Viro , linux-fsdevel , kernel list , Linux API , Pavel Begunkov , Christian Brauner References: <20200831153207.GO3265@brightrain.aerifal.cx> <20240118155735.GS22081@brightrain.aerifal.cx> From: Jens Axboe In-Reply-To: <20240118155735.GS22081@brightrain.aerifal.cx> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/18/24 8:57 AM, Rich Felker wrote: > On Mon, Aug 31, 2020 at 11:05:34AM -0600, Jens Axboe wrote: >> On 8/31/20 9:46 AM, Jann Horn wrote: >>> On Mon, Aug 31, 2020 at 5:32 PM Rich Felker wrote: >>>> The pwrite function, originally defined by POSIX (thus the "p"), is >>>> defined to ignore O_APPEND and write at the offset passed as its >>>> argument. However, historically Linux honored O_APPEND if set and >>>> ignored the offset. This cannot be changed due to stability policy, >>>> but is documented in the man page as a bug. >>>> >>>> Now that there's a pwritev2 syscall providing a superset of the pwrite >>>> functionality that has a flags argument, the conforming behavior can >>>> be offered to userspace via a new flag. Since pwritev2 checks flag >>>> validity (in kiocb_set_rw_flags) and reports unknown ones with >>>> EOPNOTSUPP, callers will not get wrong behavior on old kernels that >>>> don't support the new flag; the error is reported and the caller can >>>> decide how to handle it. >>>> >>>> Signed-off-by: Rich Felker >>> >>> Reviewed-by: Jann Horn >>> >>> Note that if this lands, Michael Kerrisk will probably be happy if you >>> send a corresponding patch for the manpage man2/readv.2. >>> >>> Btw, I'm not really sure whose tree this should go through - VFS is >>> normally Al Viro's turf, but it looks like the most recent >>> modifications to this function have gone through Jens Axboe's tree? >> >> Should probably go through Al's tree, I've only carried them when >> they've been associated with io_uring in some shape or form. > > This appears to have slipped through the cracks. Do I need to send an > updated rebase of it? Were there any objections to it I missed? Let's add Christian. -- Jens Axboe