Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp921092pxb; Thu, 9 Sep 2021 15:26:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3GIi+J5LxsvfITrrrzmJEtQMTlF5/Lkj8CnengzjY2k+A+xQMuTtToOkJu7wS36Ye/Mv9 X-Received: by 2002:a92:db06:: with SMTP id b6mr3948614iln.305.1631226379578; Thu, 09 Sep 2021 15:26:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631226379; cv=none; d=google.com; s=arc-20160816; b=PpL720ytZCpkrKvBh0NJrlM0FOq2qXkJQnn9Lg58tDQON4gHh0JJaDWtE/2SDDMnP7 r0vHy9FBg1Kmo+eQvXqAFzkdI1OkodJe1tRefkdnPqHP9mbQVTkIukFmp9JIXvrLaSw9 C7yWk5HtdYukH4wZgviBaX0qOV+CE+93za86GYPcfNHF9Xs0kSWSFx/1Gc8KYkv0DKVL HwIpyYVNpQ+kLdTLPPmwx2Z1D0OFsv5CtlZhgAQP+qNH3RtbsmLbhASJPp70FV7PChp8 jQPP2uOmNED258PrNIkPmr1reD+o1vJIVhTIEc7n+2dbrrLWrEYJgSSVxs7z14U8LHm6 ahRQ== 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=ejWm8B/glYYqr7Ut7PcEudaL6VmbufqHAGAhWo5Kdl4=; b=Qd0Z5JgjKgpMwJEeu0VO5QzB15PxU+e7z/waPFAVnJpbzNsE6vMWDPiFy3MpNAgLaH 2H5CkylWuU6corHcVbQDtDYewSftv+76CliLVxlyI5+Vsg4OmYgVHvOpxkBP0wg/CCUB EZZ2INDrKnuFM89aOzm7QpyNOz3TSRPJnWOOIQXQl4BETROcHvSb4Sq0ZdLa7blVXprX bkJ2bmV/JBE8FLdZSDkwkO1pZpaCiEpjtFqrdgYKWJHlzcarWrqT3cfHYWC9HC7EU852 ThakQgAiJXmam8FluSKwt1Yz9JfH7smTvK+wtg3tM2OXHCuyqkVjhdLOIcyNhgkbkYdk YHxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QzDfqeQb; 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 132si3125563jay.7.2021.09.09.15.26.03; Thu, 09 Sep 2021 15:26:19 -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=QzDfqeQb; 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 S234433AbhIIV5s (ORCPT + 99 others); Thu, 9 Sep 2021 17:57:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbhIIV5r (ORCPT ); Thu, 9 Sep 2021 17:57:47 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74399C061574 for ; Thu, 9 Sep 2021 14:56:37 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id l11so6591231lfe.1 for ; Thu, 09 Sep 2021 14:56:37 -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=ejWm8B/glYYqr7Ut7PcEudaL6VmbufqHAGAhWo5Kdl4=; b=QzDfqeQbem+HgggMOmfEKjqrh0fskzFB66iccfpr64IPDJ+YBb29MeGgV9yydjXjfV uwpYl3J/o1HL4+UGAqjNXVMYDRLD4ZfE8Ka6sMs2w2M1E6LyAuU+2l2HrieK8M7/PLN3 UjWQUBYDsU/0X+0gfeFc0Jz7k1zzLopyyoc9E= 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=ejWm8B/glYYqr7Ut7PcEudaL6VmbufqHAGAhWo5Kdl4=; b=CSRTE2Q8o7ZDLQO/2uoovSejYCMn6NxijCBLaqs++XNgP9I0DmM+XkDIdCj0I23hW1 KAqEX49lN19JYYzVlrx/Hf1bdOgY0TYCm6MJgpe1EjvIKPPvGVMQkpP4zu/6NuoMSSLL xureiS0y5GzeKCz+JoLOFCJpR/ohLCD18zfd8nxSrGRhTtTCpwTRFXxMiJ4jrLz554nB Ag99grqqcQ+Xya6RbzLCx3zaxbFpG3l41bRB1fZMpSG5WA+On2mcDiRNpxRMRcimxndU pJkPcbOJjytsKtLswtPFpsy9kll//SEWKRUryNXKCr5mb7OQHAg5vzecMoHtl0beIbsA y83g== X-Gm-Message-State: AOAM530fKUW5FosALAqlfuTeXGYbE9riotRGWxVclbXA63knJGZUDV2W kfUOrt6cbWE4IlK6vE8goBxxN7QZXqoL9t1Bp4Y= X-Received: by 2002:a05:6512:96c:: with SMTP id v12mr1458667lft.148.1631224595581; Thu, 09 Sep 2021 14:56:35 -0700 (PDT) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id l11sm321285lfg.39.2021.09.09.14.56.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Sep 2021 14:56:35 -0700 (PDT) Received: by mail-lf1-f44.google.com with SMTP id m28so6573378lfj.6 for ; Thu, 09 Sep 2021 14:56:35 -0700 (PDT) X-Received: by 2002:a05:6512:2611:: with SMTP id bt17mr1463054lfb.141.1631224594865; Thu, 09 Sep 2021 14:56:34 -0700 (PDT) MIME-Version: 1.0 References: <5971af96-78b7-8304-3e25-00dc2da3c538@kernel.dk> In-Reply-To: From: Linus Torvalds Date: Thu, 9 Sep 2021 14:56:18 -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 Thu, Sep 9, 2021 at 2:39 PM Jens Axboe wrote: > > OK, one that I immediately found is just doing O_DIRECT to a block > device or file on XFS. As pages are mapped and added, the iov_iter is > advanced. If we then go and submit and get -EAGAIN, for example, then we > return with what we mapped already consumed. Ok, that's annoying but understandable. Dave points to a commit that removes one of the EAGAIN cases, but apparently not some others. I do kind of wonder if you can't have the exact same case when *some* of the IO succeeds, though. IOW, can't we have that ret = io_iter_do_read(req, iter); return partial success - and if XFS does that "update iovec on failure", I could easily see that same code - or something else - having done the exact same thing. Put another way: if the iovec isn't guaranteed to be coherent when an actual error occurs, then why would it be guaranteed to be coherent with a partial success value? Because in most cases - I'd argue pretty much all - those "partial success" cases are *exactly* the same as the error cases, it's just that we had a loop and one or more iterations succeeded before it hit the error case. Hmm? Linus