Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2925236rwi; Fri, 28 Oct 2022 13:12:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM42+MJFSpdyo8QPTlZj0b8uv8lkxSLrNxYNuFdxE1LgojgjLu6UPt5tRifPg5WNiir71Zmz X-Received: by 2002:aa7:9533:0:b0:56c:8c22:6e45 with SMTP id c19-20020aa79533000000b0056c8c226e45mr813540pfp.84.1666987977880; Fri, 28 Oct 2022 13:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666987977; cv=none; d=google.com; s=arc-20160816; b=o36RbDp2qKuUw7DZo/5EsOGzf/bIysN6juCLzeLTPLQvJiXEL458QEef+BslSxiAAx HNXI376YRatzReNgKxMwIAsz9qnmPc020+ZjcNbt0BeXzWq9vQEmQgohzb+YjOQuwjDI I2nNYX+FlCXxNciPy8UL1yO+r+7Q+lnikETr3mVp37JFyMw/8KYYI5NfzW8TJqTDCvCE fX87LXWnEn+4oDUuVZjqPxuk835PeUfqLKUhZxHlT4/xXUxndfGx9kdVpZ10VrPeYUYR 1dBWKI0OF+aNT4yjqUxgoGRhloWb8YjhmGreMOGZ3+jPsZHrAELC6zbS/A5amYIbOYvQ AdqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=rXRqCxzSwwJwUn6NUaDL+hX0MQGv2CPlx00T8de0cos=; b=MNpPPiU0HYeyYPKsui4CPewdmZLHIlabfB36QKZF3gH6iR3s4YfSHNssfCuVKqxevF Tkf4Ba4UDMshzuXMiig0G5wgYzuP1OE5RdGDPKcxDtqsodyDGJRUHSeXRE9nyRu+uQUW UheFfOeAOsrWhpNtBQI7O0WLwfjRn+JQ5flMZ/4qq21hMGoIBYybo+FYaa7c/8lDMfI2 kOHCNtQLzmhZKap54G4+FTO6BvwM5rVhrnq4UZBY2WlSWOV0wh8MyDk2QHAqx7+3HK/f 6C68X6AhT5Z9xT3fk6gqy4DjtNM8ArhI3UzdbJ39iJbILG1+JSKH4CKo5p9gYvduA/+l UiGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=k+le+6ss; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a15-20020a1709027e4f00b0017f908814c6si5427825pln.532.2022.10.28.13.12.46; Fri, 28 Oct 2022 13:12:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=k+le+6ss; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbiJ1TbL (ORCPT + 99 others); Fri, 28 Oct 2022 15:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiJ1TbI (ORCPT ); Fri, 28 Oct 2022 15:31:08 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2669E229E44; Fri, 28 Oct 2022 12:31:06 -0700 (PDT) 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=rXRqCxzSwwJwUn6NUaDL+hX0MQGv2CPlx00T8de0cos=; b=k+le+6ssU0pzX5iaW/kTWOgm4b nhkSL3zT5nVqJVhVuRJK4TvRwmnHDnLaqUuWa+33dQ66uqwPEKjR4j4j9L4t1RboUwOc1Nk8nOWmt mz/UZSzC7pCS3TcjH1bbsoa537jLJ9WDiRH/HpVfMZj9CdcugRvy1mxB6bk4TGkhcCT5Ttoj96BuL bCfc5MewRDixyOuq+62XGtHBEts3nkQVf6Ij0WOUTS4g69Xtow1xtw/IxlhClbHYkhOkLGi5S4NAc 2Sd8qZ5nSnH+oEKtDPOYRfzj09tLz4dzrw4xJctoRVfgt6ij1Sy7ZerlgDLXj0BG/z3WRgj8TfwLG AThxBdyQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1ooV4A-00F1pm-0v; Fri, 28 Oct 2022 19:30:54 +0000 Date: Fri, 28 Oct 2022 20:30:54 +0100 From: Al Viro To: Linus Torvalds Cc: Christoph Hellwig , David Howells , willy@infradead.org, dchinner@redhat.com, Steve French , Shyam Prasad N , Rohith Surabattula , Jeff Layton , Ira Weiny , linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 12/12] use less confusing names for iov_iter direction initializers Message-ID: References: <20221028023352.3532080-1-viro@zeniv.linux.org.uk> <20221028023352.3532080-12-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 28, 2022 at 11:35:06AM -0700, Linus Torvalds wrote: > > Umm... How are you going to e.g. copy from ITER_DISCARD? I've no problem > > with WARN_ON_ONCE(), but when the operation really can't be done, what > > can we do except returning an error? > > Fair enough. But it's the "people got the direction wrong, but the > code worked" case that I would want tyo make sure still works - just > with a warning. > > Clearly the ITER_DISCARD didn't work before either, but all the cases > in patches 1-10 were things that _worked_, just with entirely the > wrong ->data_source (aka iov_iter_rw()) value. > > So things like copy_to_iter() should warn if it's not a READ (or > ITER_DEST), but it should still copy into the destination described by > the iter, in order to keep broken code working. > > That's simply because I worry that your patches 1-10 didn't actually > catch every single case. I'm not actually sure how you found them all > - did you have some automation, or was it with "boot and find warnings > from the first version of patch 11/12"? Went through the callers, replaced each with the right ITER_... (there's not that many of them and they are fairly easy to review), then went through mismatches and split their fixups into the beginning of the series (READ -> ITER_SOURCE becoming READ -> WRITE -> ITER_SOURCE, that is). FWIW, there used to be one case where we really tried to copy the wrong way - fixed a couple of cycles ago (f615625a44c4 "9p: handling Rerror without copy_from_iter_full()"). No such catches this time...