From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F958C433EF for ; Thu, 9 Sep 2021 21:42:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 415EB61179 for ; Thu, 9 Sep 2021 21:42:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347576AbhIIVnX (ORCPT ); Thu, 9 Sep 2021 17:43:23 -0400 Received: from mail108.syd.optusnet.com.au ([211.29.132.59]:48728 "EHLO mail108.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347347AbhIIVnT (ORCPT ); Thu, 9 Sep 2021 17:43:19 -0400 Received: from dread.disaster.area (pa49-195-238-16.pa.nsw.optusnet.com.au [49.195.238.16]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 0D78D1B9E7B; Fri, 10 Sep 2021 07:42:06 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1mORo5-00Ad4S-EJ; Fri, 10 Sep 2021 07:42:05 +1000 Date: Fri, 10 Sep 2021 07:42:05 +1000 From: Dave Chinner To: Jens Axboe Cc: Linus Torvalds , Al Viro , Pavel Begunkov , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [git pull] iov_iter fixes Message-ID: <20210909214205.GH1756565@dread.disaster.area> References: <5971af96-78b7-8304-3e25-00dc2da3c538@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5971af96-78b7-8304-3e25-00dc2da3c538@kernel.dk> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=Tu+Yewfh c=1 sm=1 tr=0 a=DzKKRZjfViQTE5W6EVc0VA==:117 a=DzKKRZjfViQTE5W6EVc0VA==:17 a=kj9zAlcOel0A:10 a=7QKq2e-ADPsA:10 a=7-415B0cAAAA:8 a=JUD6rjD155hWDKwpWEIA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Sep 09, 2021 at 03:19:56PM -0600, Jens Axboe wrote: > On 9/9/21 1:37 PM, Linus Torvalds wrote: > > I'd like the comments expanded too. In particular that > > > > /* some cases will consume bytes even on error returns */ > > That comment is from me, and it goes back a few years. IIRC, it was the > iomap or xfs code that I hit this with, but honestly I don't remember > all the details at this point. I can try and play with it and see if it > still reproduces. You might well be thinking of the problem fixed by commit 883a790a8440 ("xfs: don't allow NOWAIT DIO across extent boundaries"). This fix was indicative of a whole class of issues with IOCB_NOWAIT being used for multi-IO operations at the filesystem level and being applied to each sub-segment of the IO that was constructed, rather than the IO as a whole. Hence a failure on the second or subsequent segments could return -EAGAIN (and potentially other errors) to the caller after the segments we successfully submitted consumed part of the iov... Cheers, Dave. -- Dave Chinner david@fromorbit.com