From mboxrd@z Thu Jan 1 00:00:00 1970 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 6B31F28DAF 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-fsdevel@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