Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2896192rwi; Fri, 28 Oct 2022 12:48:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM71OkMJ87mP/KieLMkSn+n2v25jNC+rk2zjOIMmKWoLvPNEUjctsTDyLd8ULG5eafBF/jss X-Received: by 2002:a17:902:b68b:b0:186:aee0:53ec with SMTP id c11-20020a170902b68b00b00186aee053ecmr654886pls.90.1666986499891; Fri, 28 Oct 2022 12:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666986499; cv=none; d=google.com; s=arc-20160816; b=hdgPU9A9R8fTxGlYedbzJEAuq+HE4SVfPz3Td+w7pkiVjJwvqZzeyWViUY2gPkqnD3 0S0hKLYS9QHbZvoVffLU7uXgNiCfHJWjquEUyOpqFvlFFjK6yFWoT6tBVwYQEHw7DKBN wQWScjhwo6LiAdZgI6GqiMVN7Ejt/jel9gaVEAYyU4NammYx/oHobanyrVPQeHcNZULS pMnJ8KbPHM2I3gkvg4dPLBat6mNCTGmIqG36Xwv6d7H+qV3zlBYYpp0FaxktscJCWkgI z1s3mpieU5Jsc2MXYC40M03Q2rn/W3lkVkZ60GR1+pxVEs3RtFl7AIt90xhiTtYenLuM t+PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=554KCjWn8qBcAcBVpoouhKeUYG/Iw1xaVWw3M5KddOs=; b=ii1MSjnjTHAEoZ+kl9wKjNFC0Vu7M6NIWEmmUz/acHNhhXTxI8AoYiM84OVJftdXnb HIKzEFzM5PqSqsC918xmI0F5yKq8iJYPt41r6PjWJrYIE/UYSJNP7rUIZP3A/5q17Ad0 slKNv1LORM2WiNpqZQnmVUqaJSDUfA9S7dMtm5EZuaiZMbbfRYyNsXUPlhBDHKt01jaA ADeaqOh3rJzjdzLGql9TORowaeB9J6Dtu7lMwEgREO4kT+ShFdqkVSxS3MwjNelZ+OIe E5TeKrXjKujxJV7g8HU9LJn/qFHb/dPD5NwlBGXzO9tKW84wKanta5TrsRl8c7L6yx0u krzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=DCzroOtV; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a056a0010c300b0056bdae22580si6996957pfu.338.2022.10.28.12.48.07; Fri, 28 Oct 2022 12:48:19 -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-foundation.org header.s=google header.b=DCzroOtV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbiJ1Sf3 (ORCPT + 99 others); Fri, 28 Oct 2022 14:35:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230041AbiJ1Sf0 (ORCPT ); Fri, 28 Oct 2022 14:35:26 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 776CD63362 for ; Fri, 28 Oct 2022 11:35:25 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id b25so4010328qkk.7 for ; Fri, 28 Oct 2022 11:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=554KCjWn8qBcAcBVpoouhKeUYG/Iw1xaVWw3M5KddOs=; b=DCzroOtVcESn8/j0p2284O1c8+f71f2wa1HhtWbyeBVb5KrtXtesUm1DKY6tLO/CqX oBob/TSHMKmFbqkcAbw8pVZOUno4hI+NzeRw7haRuA1X/fp9UYA0EEKK34zd9GG+8Fmn h0agPHPClfZ8rFS2LoP6wiZ0asEbvErvPOO6Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=554KCjWn8qBcAcBVpoouhKeUYG/Iw1xaVWw3M5KddOs=; b=IpYM0UBZLNICOboR+KaZIpTGvjju0oL3jDkJQKoN9AS2lquKOeqPlbRSVtZ3Q9yvyX 1U/zj1sFeQ3gdnaJCrMdv9D2B1UOi8S5I9YDzV5ZBWossNik9dVZeQF7gLoM9WVbnoQF JXlckS9Pev1ntjkuwJrBIEd7CPhAEbBbAlRYRArxaUAp9KGsrgLI9I3MNNxi5fkUfS1t gT0Mpye/KCqLlfy/1Y5Dl5NbY86/0QvAMDE5lyxLdBDjjbgV1d2gE/Q81R+npuLtzBSp v0uzrB82ULED3YJ7BopoSmEXsRMYicT8NJT9VrxEhbZHdI6e/yZxm0m3HgfYiX6sC029 UkXQ== X-Gm-Message-State: ACrzQf07ikZ6GaKHF3zLF/1SZvOxThhQJRPfXisl7enU0DFWuE5ZxHuv X73rxWyns4b0fGidY1uKiQd0ZuAcm6qUzw== X-Received: by 2002:a05:620a:1d0d:b0:6ee:3a2e:d225 with SMTP id dl13-20020a05620a1d0d00b006ee3a2ed225mr550740qkb.10.1666982124422; Fri, 28 Oct 2022 11:35:24 -0700 (PDT) Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com. [209.85.219.179]) by smtp.gmail.com with ESMTPSA id m8-20020a05620a24c800b006ce515196a7sm3460267qkn.8.2022.10.28.11.35.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 11:35:23 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id y72so7054276yby.13 for ; Fri, 28 Oct 2022 11:35:22 -0700 (PDT) X-Received: by 2002:a25:5389:0:b0:6bc:f12c:5d36 with SMTP id h131-20020a255389000000b006bcf12c5d36mr619498ybb.184.1666982122579; Fri, 28 Oct 2022 11:35:22 -0700 (PDT) MIME-Version: 1.0 References: <20221028023352.3532080-1-viro@zeniv.linux.org.uk> <20221028023352.3532080-12-viro@zeniv.linux.org.uk> In-Reply-To: From: Linus Torvalds Date: Fri, 28 Oct 2022 11:35:06 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 12/12] use less confusing names for iov_iter direction initializers To: Al Viro 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 10:15 AM Al Viro wrote: > > > > I can see the logic: "the destination is the iter, so the source is > > the bvec". > > ??? > > Wait a sec; bvec is destination - we are going to store data into the page > hanging off that bvec. Yeah, no, I'm confused and used confusing language. The bvec is the only "source" in the sense that it's the original destination. They are both the destination for the data itself. > 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"? > No. If nothing else, you'll get to split struct msghdr (msg->msg_iter > different for sendmsg and recvmsg that way) *and* you get to split > every helper in net/* that doesn't give a damn about the distinction > (as in "doesn't even look at ->msg_iter", for example). Gah. Ok. So it's more than just direct_io. Annoying. Linus