Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp319984lqp; Fri, 12 Apr 2024 21:15:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXX4rHNIrcNm80OwLmEmVPtjww8uJPa7FuBhizBnAVFnzKJmZiTZ1sH/J8O3nKzqgr2EkDwVA5L16xFgxTJzbti6fOOhtHtsOD5CcxE+g== X-Google-Smtp-Source: AGHT+IEjUUsZeWOjnPkQIfE413GCM7NovIYlrwUdJiUahPsyJ8tfxvzFH1x0vOlqttNT/YAFjvnI X-Received: by 2002:a17:906:c094:b0:a52:3623:f498 with SMTP id f20-20020a170906c09400b00a523623f498mr2758674ejz.31.1712981748116; Fri, 12 Apr 2024 21:15:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712981748; cv=pass; d=google.com; s=arc-20160816; b=GqjlmMw7rg59xY2uvyfWVDtNPCmtYQDCsstYJgGH6txGRSHha85R3UpnW9IBzeFX+A g6tll/qpSZOZ96YcX7EHwZaWskERDeG0eMzb74tLsrOxkY0TNL8RZLRXa9AXwsfX1lUe t4WbMsdLcTBWL1jFnzN1cnMLtEMAAKyznGvp/8aQOONI2f0kHtugD3HrAKkuMYFoWbSi S2fUlysAUzqIp6fc34v1DG5ozx9Zm3ETKTuK8r4HTn4xBIsE2641VUfRDI9BFUzPcMOA GEhOPYH/pNMF/VcQ0JDjexKcOU7km3o6rTrYPZf86xXSvc2UqsnOxIReEiw3OMHFT7wM ahAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=L8fKgzAxuXRxYh8g7LfILxb7Rk2jCjze6hOtopuCmrs=; fh=Vr1Td+7qQ6XtZNcNXq6FkJeLRTopXefc/04D11YiJ1U=; b=Xo4i1CtvEqTI3V0ypZAuRn5mp+Lf1vCFyHdaJTjt+ATw30VZvp7wiIebUixnBu4BRM ULt5ohWHbtaEwdHL3xPrW6/kyhn83rJQ+p+mIjyrC8+xDRLnJzDUZ+akx2JTrhJM+phA YX5L3R0pwXzXItaV8jUePv71bBlYy7aj6xYKuLPSXlwPyyShEhw32EZ7c2mbV8r0jamU k9MU1J7lwaECzACO6xpen8CUqZ2tiMuftzZau//gnZUuZyI5cglD1TjMJegjxyagZSrM mjC5GMA0yDTbWbgeTIFZPd7c1yTDJuEijzbs8bxkaN9g2MfyV2hUZArC4fWGrGtNPP+d /1XA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=FzCAOtmk; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-143573-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143573-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a19-20020a170906245300b00a51938a6fbasi2296322ejb.738.2024.04.12.21.15.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 21:15:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143573-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=FzCAOtmk; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-143573-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143573-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk 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 D1B3C1F248E5 for ; Sat, 13 Apr 2024 04:15:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 360111C6A5; Sat, 13 Apr 2024 04:15:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="FzCAOtmk" Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6E5A1B964 for ; Sat, 13 Apr 2024 04:15:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712981739; cv=none; b=KVWW0Qs4xaN38hbQzFrPV4oC9u5RDJ9+1tX1E4Q3Erq+5zXTbzxbeEjamdIS5QHtLe4MR1emU4DnBiDI+1Zzaw4manBfwIGlcXUQZWpbvVcF0GrBMwX5Zftlb2wIZ07H6GHtsftRegnYjyjBjyXAFkHv6cT1p3kB3+7RiSP3pKo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712981739; c=relaxed/simple; bh=2j9ShjLfSgpt1dRoNoPWk+SPK9pwF6GyYMHgJkLP354=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gv82hNGHZc8sPbnzCKGr9eg1HyKCxqFGEzJAwaSlj/USAtsD3WV35swAbHyGjx+uvJ/cOa3j6fCt8zols1enzbmXeM7zELJBs6tPXOokrdPNT3UxHYOJjgXY7FJQjHW4n7CLuRB168kilfftov12iw1PUaizafv2th3OUztwqBs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=FzCAOtmk; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=L8fKgzAxuXRxYh8g7LfILxb7Rk2jCjze6hOtopuCmrs=; b=FzCAOtmkGaE1V42QVhtfTNNNlv XWhLtGKHlChkI+X7K2IBnUBZRCj1QQo1+hD1ZzsXANwAA3HX9LXXTo3m6w/V+/WsupB4a11tsAvOJ /dG/QKK6qoE/qjKWXTTQ7QhXgI9MdiZVkadG3gi+cY/suKTWVbDHTtifOfpw4BvrnXfcpKux0lmwo MOkYdPbtOJH6ZFuO0Ds4xYmOnsxsL27rgk5d9VIxDPOHYviHEvkNNe2STWTYlVyYJbot4ji8eWQxo zy+HUoWKPIYL7VjJdZKWvOn7vGZnKorfWdL3qFP9IeGRZgxpw86YLLUVMN/emUTMAhSZAH+84Mu5L yLMROmBw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rvUne-00BYVm-0r; Sat, 13 Apr 2024 04:15:34 +0000 Date: Sat, 13 Apr 2024 05:15:34 +0100 From: Al Viro To: Jens Axboe Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCHSET RFC 0/437] Kill off old fops ->read() and ->write() Message-ID: <20240413041534.GO2118490@ZenIV> References: <20240411153126.16201-1-axboe@kernel.dk> <20240412042910.GK2118490@ZenIV> 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: Sender: Al Viro On Fri, Apr 12, 2024 at 07:58:13AM -0600, Jens Axboe wrote: > I'm aware of some drivers that do different things from write vs writev, > or read vs readv for instance. But those I did cater to, by having a > flag they can now check. > > Can you be a bit more specific on an example of a driver that does the > above? Consider e.g. your #39. Current mainline: 1 call of ->set() for each segment passed to writev() on any of those. With your patch: call segments concatenated and if the concatenation looks like a number, a single call of ->set(). If nothing else, it's a user-visible ABI change. And in cases when ->set() has non-trivial side effects, it just might break a real-world code that is currently correct. I picked that one because I didn't want to dig through the drivers - I'm pretty sure that there's more to be found there. It's not just "write() and writev() parse the data in different way" - we do have a couple of those, but that's a minor problem. "write(fd, buf, len1); write(fd, buf + len1, len1 + len2); is not the same thing as write(fd, buf, len1 + len2)" is not rare for character devices and for regular files on procfs/debugfs/etc. For any of those you need to use you vfs_write_iter() helper or you'll be breaking userland ABI. The cost of audit of several thousands of ->write() (and ->read() - similar problem applies there) instances, checking that property is the main reason this conversion hadn't been already done.