Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1654566pxb; Fri, 10 Sep 2021 10:33:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJ6ue8C2uk0MDqQavYXZqclSBIS5tULTJE9P7OM+0ZPQR5PDUW/FZqOx36Rq6ZvBOUG2jH X-Received: by 2002:a17:906:f243:: with SMTP id gy3mr10691122ejb.327.1631295186040; Fri, 10 Sep 2021 10:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631295186; cv=none; d=google.com; s=arc-20160816; b=OhtVk7RjyC/+XuaUpOyQs/2/IHINYCalDE4+7YCCa3N/KiUD2mEQPyzhxiuJiKsxc/ LuaKLNgfr8YWCfghFT9gmyQdcxN+HwF9xMULrvEAPjRV/oFKqhQZkP8LGrZWmHkKMir7 hhEOt5CCJgNHL1461BHZB6qVsXZRE12v71jeaacKTnCI452ccPhkSuCQd4odcTOo2a0b aI7k1oZViOyLOiHegHJ1a9V/VjQ7Zx3i83kUPmVp3m5FFiQ5eR/nfE/x3JT1FE2LTXHB +J5ZTNJxI/Qz0/ftdfSnddWmxtiXGua0D8ONBb3hab/bz8IVrn9Aq1usSg48SgwogObk ZHtg== 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=TUgCj/lJopc0GwjVatWiteMeBV8t5YRgw6JDQsFTQ7o=; b=fp6Wk4lTlxVZW3apVn4tTWNg3fp/oUcTVCEiHTTlFkU7PCFvYYj4Z7VBCt0xzWymRa Z178tMy040GKGLRZ2qg+6DGsDSndHFQYYf69nDurO7q1DWWHI9Fv4oHU+fqBJMNZWYZu NHlbhd8+k51uCVunIlQP70BlZe8zwRjnUm33U+WDOR00A2SE/9IK2p7j88+I0KtaDewp 6aR94j4fCvSfPe5yNo+tX/2zamgGUZ7dWY+6vZLHJh+NRZgVjVhmune+R/Ssshs6yA55 B6N914u64nCE319Jh5UZiYCUve7fYgpY1ZtqO7UBjifhXSoBvH+DaYTveV+PAiDsMi+P 69uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Hi0tAii0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si6210299ejd.405.2021.09.10.10.32.40; Fri, 10 Sep 2021 10:33:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Hi0tAii0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231386AbhIJRcb (ORCPT + 99 others); Fri, 10 Sep 2021 13:32:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbhIJRca (ORCPT ); Fri, 10 Sep 2021 13:32:30 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8229EC061574 for ; Fri, 10 Sep 2021 10:31:19 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id bq5so5519996lfb.9 for ; Fri, 10 Sep 2021 10:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TUgCj/lJopc0GwjVatWiteMeBV8t5YRgw6JDQsFTQ7o=; b=Hi0tAii0nMOtwacqzu8IZaGMEp7ICkxhr7NLakzC6M+Q7SL4Wvl5+8y67U3RycwtZ6 vGeyzL7VxnXJDGoZW6peZk58phA/fDES6k0uCAqUhgYMj1rFC4b4PVhooiXP1/HRZpeT XTWd30Wr9y+VE+2+lEs+nEFQ2Ou5n+9fS27XY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TUgCj/lJopc0GwjVatWiteMeBV8t5YRgw6JDQsFTQ7o=; b=pn8TeHVrsmb7GyhGkacpjyN/E9CLSyCcStH6QZpQo7sCHvTqxKm8XUAcj9v7czQXvq svWLepWa5l3Z7tjdAM1c6PlHQjQs/C1Qg4rbijdWtqwQ81FuJQVHTZh4NtqY0V1v/pFf FylItrNsgt9ciaUC/Y5uHgSHQ/rYwK8UD/6wHjO7Rq9lsqxbltCOdOiQ4gCvyccmMSVr sQ7jvQlyogMf3ar1kRRLT1LzGb6wiLNEeLBH9f5bT2tnNYfgkUU5gEmhOE05Ax7N14m7 z1zyUx2C12dp2ygQw5mz/XHrQxrW1b+SuOP4GtUQx18hnNaO7iamMcFv7RaJmC7xlzHR T2JQ== X-Gm-Message-State: AOAM5331KfHxjRmdxIX4dtvwRqHpCH3foKmPOs9WVuTnAA8CXLEpko+d YQSbDeUPx16u2DttshN0HwB1O+hWdbwFAZQaL4E= X-Received: by 2002:ac2:46d3:: with SMTP id p19mr4721254lfo.689.1631295077534; Fri, 10 Sep 2021 10:31:17 -0700 (PDT) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com. [209.85.167.48]) by smtp.gmail.com with ESMTPSA id q17sm616794lfo.232.2021.09.10.10.31.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Sep 2021 10:31:17 -0700 (PDT) Received: by mail-lf1-f48.google.com with SMTP id i25so1579550lfg.6 for ; Fri, 10 Sep 2021 10:31:16 -0700 (PDT) X-Received: by 2002:a05:6512:2611:: with SMTP id bt17mr4847412lfb.141.1631295076349; Fri, 10 Sep 2021 10:31:16 -0700 (PDT) MIME-Version: 1.0 References: <9ae5f07f-f4c5-69eb-bcb1-8bcbc15cbd09@kernel.dk> <9855f69b-e67e-f7d9-88b8-8941666ab02f@kernel.dk> <4b26d8cd-c3fa-8536-a295-850ecf052ecd@kernel.dk> <1a61c333-680d-71a0-3849-5bfef555a49f@kernel.dk> In-Reply-To: From: Linus Torvalds Date: Fri, 10 Sep 2021 10:31:00 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [git pull] iov_iter fixes To: Jens Axboe Cc: Al Viro , Pavel Begunkov , Linux Kernel Mailing List , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021 at 10:26 AM Jens Axboe wrote: > > On 9/10/21 10:58 AM, Linus Torvalds wrote: > > On Fri, Sep 10, 2021 at 9:56 AM Al Viro wrote: > >> > >> What's the point of all those contortions, anyway? You only need it for > >> iovec case; don't mix doing that and turning it into flavour-independent > >> primitive. > > > > Good point, making it specific to iovec only gets rid of a lot of > > special cases and worries. > > > > This is fairly specialized, no need to always cater to every possible case. > > Alright, split into three patches: > > https://git.kernel.dk/cgit/linux-block/log/?h=iov_iter That looks sane to me. Please add some comment about how that i->iov -= state->nr_segs - i->nr_segs; actually is the right thing for all the three cases (iow how 'iov', 'kvec' and 'bvec' all end up having a union member that acts the same way). But yeah, I like how the io_uring.c code looks better this way too. Al, what do you think? Linus