Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp560945lqp; Sat, 13 Apr 2024 08:38:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQojoVeDtxY/4bIoZchEHixlL6vAoKLTuWOYKp26SoGwrk6THctibr8X++eOyuYyRdWrCEsBnTzotrQG2AWpbfXmkxQ1PPALRd0HGYAw== X-Google-Smtp-Source: AGHT+IGiRloWHgHRnOwIbW1ApojnFd3bKM61T0nZ519VDOG3G8BJrwcJKUe3F/UB8mU3+hLmbr9f X-Received: by 2002:a17:907:6d0e:b0:a52:571d:be28 with SMTP id sa14-20020a1709076d0e00b00a52571dbe28mr391956ejc.73.1713022686969; Sat, 13 Apr 2024 08:38:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713022686; cv=pass; d=google.com; s=arc-20160816; b=jPoC6Jf2NFhxG4dy8VTjNe9u2n2jaqAfweiVUn0TIEUEWPhxjD3ewNhtvvoaSoLlIz XdCdTGsHlVl+xhRXd6NDewQioyV/Y67hLaFnZIfki7ONnUkSawfnq3MqthllRxw74GMU r2FYKz0/v8Vjbh5E5FtOAzsC0cu2MZrdjkpzTW4NS583rFoAq68H0AdDGfcQTs76SxKA BJsjWkGeZiUjN5QFhLCT9iaNBVhjjYPahE4EPy3UKCvu0J/N1ic9YAr5BtV6wKgjoOfB Nk7oXjeTqHl0wUG7H43iqfNGlcHmdSCSwAf8c7q3TFSiv63z7ADT7P79l1P3vZF9MpEC huCA== 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=AEquu8amiB2wVboaCCSnNACWolHHULyORulIDsvatsY=; fh=y9c1EQHB2+CpidlMiDIasitSN09CkGKNPOkGCHzmnLM=; b=P7GBwBSI/C5XCbco8vvVS+Lt8bTZQXHEimSTbgTaHg7I7coziku69XIVQJ58a3Oqhy AdN/vlIONtf3dWyESviqKSrfm+xFa2mutD06TbmibEsJMwh9Ild6OEtB5OucT0sZFpH8 ei+bEUB5B4yVpEWFaRylcCMtoAsaXk+S9MC1Uz0t409KkZuqGOwlzke40+uuU/+kKiYk U4SQtzmdy15juHMEwffcIZhPu7G3iy/ek9r+D0BkehSa21S99GHVwkciAOpOOOUG+GQL r5jwB/UvtvRJs8IRizyX7zXExNz7SDIsJEYGnxK6NM30SzE+6dxlJRfTEXjC4Uj6nMX3 L3fg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=CeiU6+GY; 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-143786-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143786-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dt22-20020a170906b79600b00a525156c468si499509ejb.916.2024.04.13.08.38.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 08:38:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143786-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=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=CeiU6+GY; 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-143786-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143786-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 B0D741F218D6 for ; Sat, 13 Apr 2024 15:38:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95F56481BA; Sat, 13 Apr 2024 15:37:31 +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="CeiU6+GY" Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 D8D4447A52 for ; Sat, 13 Apr 2024 15:37:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713022650; cv=none; b=QOfXKQ5Wfasgu0alSMg7HSgq7jm74PwBMwbTMt3YmbU1J3J/m03ZN+tiKYJLffhgZgKJ5us7Kd2UTd2nKAJsHXX+P2R2qs0ZjA3ms9IGZtDOhhUEvmXYbG28d95mJ4d39qEdyuWeo5os8N4EyTssaFoKWcbtp2Q9NrTssi28OsA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713022650; c=relaxed/simple; bh=zdiyRGeooSWP5pvS0+7HeX50Nk8+IvWk1rGHJTHhILA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KPURJxeLmopA8T+zM2vy2PlUPqALPzY9gySXkhhSMdKr5iwMRsuxzXzTv41Q3KrT2gUm5TEu8WGj1aaDSnmoK2rNkhpKYYJ2g0X7h5cdMi/8wsJ6KedP+P7qoQ2TvXNvj+8Gr21Buahl9Sq0E69PnIqqsdkE5ffDtd2eHiV9R3Q= 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=CeiU6+GY; arc=none smtp.client-ip=209.85.214.176 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-pl1-f176.google.com with SMTP id d9443c01a7336-1e2a1654e6cso4252945ad.1 for ; Sat, 13 Apr 2024 08:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1713022646; x=1713627446; 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=AEquu8amiB2wVboaCCSnNACWolHHULyORulIDsvatsY=; b=CeiU6+GYMhuIU5T4u7/0WTcCi6s4RssOol4gMR5XK1qUoBG0MD15KZVV1dMVdDn3pT +RA6CqtvtReR97hWHsBU255Hv8CaPmrvl+ZV0BfXRYWIi9T9arAwDuBklOPoleYx1X5A lJ4ZTwMkfj9glQGHdVE4rEu/E7T01ogYKfvPpPgXblQOKXyA7yjUd+xjwSbLLs95RW6C aZ9JzhR4CC08STQ9TEWIGIh8GOKMeb7qQr9lSZsEEqDmJo6Cad6os2m5uoXeDSPnpfQ1 ajX0O9AS5IqktmFzBFCaMrgi73lMMIkEQYdCxxJN4JYNUTcnAF4m0UhxdObKsw3Yj69Z rZUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713022646; x=1713627446; 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=AEquu8amiB2wVboaCCSnNACWolHHULyORulIDsvatsY=; b=GRMris916yw9WYhSsDna1xJ/llN0nUz3XSGHxT0OzSlWa4wIi0NY1rWNy0IS7ts4iA mKlYOjSK8nnhW7aVBkJU3cuKurQn/0h90FCRjdvQZ9qCnMrT0HIunwe3T6ZzAQJkgYdX D5MvgKGAqinwHVVg6VcdY8R2rdVgTalYYNHnkiTfWjXNuosQx5l05OrPrLteqiRxegTc k9Cq1a0Wfsqhyrtz+Co8i5Q5wqicegwLJ28/+ZSo5RdCl/ZgYbQR7SJzKARsH4ZVw3F4 +GONvhs65d/SK5voNANUFIEeaNAZajFEgegk1gpvXvo0ulGrEEdEyfSQ0Gkv4FryKh9X Oo2A== X-Gm-Message-State: AOJu0Yy6SOos8oIcpW+0XtU+p07jCKqSGqaHEx39vMC2TYtPg2+8PB3D 4v6OsJ5i9zza4pI8ZmmZ/7eAh67/cF6GYzPjhjAr5X4G6WE6DtWjeTNh77h/OTfR2C5pepOtaVJ d X-Received: by 2002:a17:902:ea11:b0:1e2:2ac1:aef0 with SMTP id s17-20020a170902ea1100b001e22ac1aef0mr6549398plg.2.1713022645798; Sat, 13 Apr 2024 08:37:25 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.194]) by smtp.gmail.com with ESMTPSA id q16-20020a17090311d000b001e2b6baa838sm4726478plh.122.2024.04.13.08.37.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 Apr 2024 08:37:24 -0700 (PDT) Message-ID: <8513fceb-6a5e-4dcc-8df1-8ae81b6db77f@kernel.dk> Date: Sat, 13 Apr 2024 09:37:23 -0600 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: [PATCHSET RFC 0/437] Kill off old fops ->read() and ->write() Content-Language: en-US To: Al Viro Cc: linux-kernel@vger.kernel.org References: <20240411153126.16201-1-axboe@kernel.dk> <20240412042910.GK2118490@ZenIV> <20240413041534.GO2118490@ZenIV> From: Jens Axboe In-Reply-To: <20240413041534.GO2118490@ZenIV> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/12/24 10:15 PM, Al Viro wrote: > 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. Thanks Al, I see what you mean now, and yes that certainly makes sense. I'll go over the conversions and see what might be affected, and for those we'll probably just play it safe initially and use the FOPS iterators helpers to avoid changing behavior. -- Jens Axboe