Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp437557rdb; Thu, 18 Jan 2024 07:57:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGT6A7bJnYxH29ayG2kxCVRt/YnZiXiPeHsoRDwnkQYL/JJmM3J1xygwT/jyXIsoTv4ZLNE X-Received: by 2002:aa7:d391:0:b0:559:6574:8c80 with SMTP id x17-20020aa7d391000000b0055965748c80mr679259edq.14.1705593465597; Thu, 18 Jan 2024 07:57:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705593465; cv=pass; d=google.com; s=arc-20160816; b=S5Mjd7DX5Rw4hZdQW4MI0wW/fmHcygJhlu96LN9KLgokn9BG8dTxdAVqY6aGxM7cSC L59o+mqZYZk9JIGHvNv+IkbJhKd/GGLJOpOsQe1kA9wnk+sl4+mHzD9u3Y0tgx7n8p42 3o2DyucBBpvV0UReBUaARbhxSYkry2Y74oW0Wjf5WGptkNj6mDNp/YdCy8DjqgEbpGKA MF3cqmkF8JJgR/DUgmjheynBzvDZe055Tcv9kaV6REIHf19dbJKrqOgZ4VRuQoCgFEbY 6OLNb0PbPQL0rOpcm4aNikqhqHhQmRXzrglDVpw+/072NKFCapbUdvOiC6kUvQVets6S Oi0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=+p338YecPeg48NG5ZiD1kQrN/gZ32Tr/w2uA1SjVlFM=; fh=H7O1+GOhuFPH4LgPMOzIkn4biqBAAqS5EfzWtaEtVtg=; b=MFHOtyzx1PO93HDPj7F6QzIA1V0Zqzxae8b/j0j6/1h9lQJFN87pivatYPaCnFbm9j RIMHJvXO7coQvNtxRBAVQpXvFxg6zu6ovMqkjjrkSTD5cQ3m8FeNDQ/M/wXtNcgVAZEn enXbhQLsKAMfFJETGmqSpFELSUac/ODeWaZfTIeGHSCWCYuAlFGnlSwk8IKO5ueaRugM m6648NI9vrsuq8BPX1qd6YBu79VgRTXnYAk7rEFVQaksDQov3L3/PZSLEJHfTZwSzpWg SLLoCiuonfkLQ2JtjNkpYbGrHRawf2w7z8QqvisK5Bh0ReZ1aMoKfCDZXSZfMb5hQSCz Vz1A== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=libc.org); spf=pass (google.com: domain of linux-kernel+bounces-30320-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30320-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b19-20020a056402279300b005570d86435esi7235261ede.206.2024.01.18.07.57.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 07:57:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30320-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=libc.org); spf=pass (google.com: domain of linux-kernel+bounces-30320-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30320-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 57C631F222D6 for ; Thu, 18 Jan 2024 15:57:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1D9328DC7; Thu, 18 Jan 2024 15:57:32 +0000 (UTC) Received: from brightrain.aerifal.cx (brightrain.aerifal.cx [104.156.224.86]) (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 6B2F528DAB for ; Thu, 18 Jan 2024 15:57:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=104.156.224.86 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705593452; cv=none; b=Y1cXrhZk0OxkHrWY021XsyZMqU9qSWvXIfi4KWs0zcAXbVGH7QQ0OLvmOSdo4Dj0utF+pTG5XI2aCatFHOaa+cfszUnRxZfEb0WIVgMxgsTy6+eWBkcdh/4bdL6tIAVM/V8Tqd5/RjF6tAuf3J8rx1HI2mHnoI7RDtnBHGUxKuc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705593452; c=relaxed/simple; bh=IRyQeRsTU4B2bpwbcSVi8B83C3AiwhoAZyPmEFIonTo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=crc3QTS9M1TXh1keSz3v6jEhi551eKnVRFyIc8sXr7XDjsM/ER+WY6XV/AagSaxclMGTupNLqO5AUH3mVrHwUqdGdk1IjyEGjkM4ywh9ekQKMvOLPoQp7hvuq2aHrKhVmURvxZjtoI3zqLctyP9T6wD/r7ZkE/EoNMo7GMnaOLc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=libc.org; spf=pass smtp.mailfrom=libc.org; arc=none smtp.client-ip=104.156.224.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=libc.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=libc.org Date: Thu, 18 Jan 2024 10:57:37 -0500 From: Rich Felker To: Jens Axboe Cc: Jann Horn , Alexander Viro , linux-fsdevel , kernel list , Linux API , Pavel Begunkov Subject: Re: [PATCH v2] vfs: add RWF_NOAPPEND flag for pwritev2 Message-ID: <20240118155735.GS22081@brightrain.aerifal.cx> References: <20200831153207.GO3265@brightrain.aerifal.cx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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? Rich