Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1655108pxb; Fri, 10 Sep 2021 10:33:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKeO1pry+Jz/Zmlq/xYO+0nbvt9rEHPHmGGnMFzd1OL2tLNkP0LsvKhYQT8d8mrjjB6O9d X-Received: by 2002:a05:6e02:20cd:: with SMTP id 13mr7350874ilq.156.1631295221863; Fri, 10 Sep 2021 10:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631295221; cv=none; d=google.com; s=arc-20160816; b=HLy1VEmZoDFT8dM/v3smzXi1nboFr5I+4UP2eEtw1hNCB8zUYD6ZnE1RvsFUBep+y/ 2JyV+qlZ1jSe81Wm3rKH2HqGgnlRpL3n4phTgA3F1UGkAmEH9C0x+L34tVkdIMt6Fgxr 8rygxdWkq8ZhFepZZeM9nTPbgiVeAmQEVOF1qcTJm893WYK1yVbE4kreH72ecYlQajM/ E+wkQdjo+8+p7zM1Z9wOF9xuiYz03EmrhA9+sOD1HRuwNRoYFsiowM+6vHUa0dkkuVW0 FhTbcNZbZC7kWLTXJqrFdQxKYeVx6xz+RxnaJ4Sj9m0n5ng4v8ACmb6/8594M1Y8gLnV 8QZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=f2dLcPzX7cfQUaVCs15ea8SZuZgriTIC7Sx2pMINImo=; b=0NGHXzWTqwfkLRcBp3tyqZ58fBoQx32/NL0/fnOxyFA12OCqDr+S5RkI+A3wi1QU9y OQcZO2BCE2+APFcMUNldGOhg2/k8+fA3th/wvQVaXa5VzZVcr3bYS6cGcAPjsa+dBPSh DArSdU+FSxw7a3OKkWOM9ad/r9Jg39cblGSoiBeOC0VgqOZflmIc8Ct64YJzDlC7cDy6 FzVvBnozOpDnJe1OOUtipuQua4snpQES3dOUUNAuOjTNY61rbxuKY11SK9CPLEAXIVjl ErNu/4ukh8ts503z164pZYaZAyyvvnZsrQl21it0iawODglV6GkFu0GImr3HGgJPsvht mHKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=lxKG7dCs; 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 k14si5138578ion.22.2021.09.10.10.33.30; Fri, 10 Sep 2021 10:33:41 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=lxKG7dCs; 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 S231842AbhIJRdm (ORCPT + 99 others); Fri, 10 Sep 2021 13:33:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbhIJRdg (ORCPT ); Fri, 10 Sep 2021 13:33:36 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2C1CC061574 for ; Fri, 10 Sep 2021 10:32:25 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id h29so2821527ila.2 for ; Fri, 10 Sep 2021 10:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=f2dLcPzX7cfQUaVCs15ea8SZuZgriTIC7Sx2pMINImo=; b=lxKG7dCsVsIRT3WhD1ltjaCzU3IouFtkfz322POaURYR56JVHdi3jaV+mNenJrMAoO 0S9cNvEUcNm54FnlTJuf4/qRgoO3zj0fuLfoO730BCXdhJQbd/GFJgQXJcrLbAt/Rywe oaI30prUcl/0lgKvwBCSXaT5qFjSbWw3gH0VX3kuAaBhR+1XYA5xKyMp5FfOvKFRI1w0 leQCiVdEZBiG/t+MxFVb+bmyGCXrjS9/s06K1ubLpsvybARPMtDseXIvh1PEDOsoZMbD wfsYPr8EZa0WIFJs1K3SJLfff8mVh4byI9ijH2URXVjMgcFKVsGp/sqYsc0lopRwHoCI wlbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=f2dLcPzX7cfQUaVCs15ea8SZuZgriTIC7Sx2pMINImo=; b=WLWLUZEDSEQgpGJb2s2JIf6rE2FTd8XudJEi0Jfgz6hu4F7k4qy07U/aEW4vRV+rZT 6QK+HSEDKCj+ioLFvDFuCWb6TwzdDZ69wHhwLgVaV74n7MdWk3K/aM3yP6w/e7kuobGq zVhLbo/7eTJPNTTjqBwBfDmvuS+joaE/w0diknG6Rn4zRjgyZ5qJjerr26m/izitb8KJ lEXFmIfGAn5PQlkYUZgDtqic5D3lizzmaMhNqALw3ixynPVrW6Ccpw2OHtmpp2JqFMBA m/aex0N03A7Y1cj6xncuwvcxA52gvBFbfCijw9yTJg2uTfu+STlKMoCCOAVY/T1OWD5v ViJg== X-Gm-Message-State: AOAM530nezq5LgSD4l3eVESphfThltAotVqxgfVp2a3kRz4A3au/1LwZ Gl6EO//+bBuMscIKSdRiJ8L2XL4KYPky/WWe4Pc= X-Received: by 2002:a05:6e02:1888:: with SMTP id o8mr7489223ilu.124.1631295145252; Fri, 10 Sep 2021 10:32:25 -0700 (PDT) Received: from [192.168.1.30] ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id n11sm2722887ilq.21.2021.09.10.10.32.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Sep 2021 10:32:24 -0700 (PDT) Subject: Re: [git pull] iov_iter fixes To: Linus Torvalds Cc: Al Viro , Pavel Begunkov , Linux Kernel Mailing List , linux-fsdevel 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> From: Jens Axboe Message-ID: Date: Fri, 10 Sep 2021 11:32:24 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/10/21 11:31 AM, Linus Torvalds wrote: > 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). Good idea, I'll add that right now. > But yeah, I like how the io_uring.c code looks better this way too. Me too :-) -- Jens Axboe