Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1073818pxb; Thu, 9 Sep 2021 19:51:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXfB+FbTC1RpzIJo05HRnzjwX3K+KawzrjyzDVfPi2w6Hr1oCW4nwmHs2cHsr8JuURXZ7T X-Received: by 2002:a05:6638:381e:: with SMTP id i30mr2570947jav.9.1631242270418; Thu, 09 Sep 2021 19:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631242270; cv=none; d=google.com; s=arc-20160816; b=L0pQiJVdvDTqxJUi3dG4TOwTy0YFQZaPXtk3tMhQZWbaU+cYbGWzHlRxnrCNOwrV+p eKczrYLjLY81l6fSnUoCSyZGfiPtuE4Uyo61Ff3aZUjb4GVD00OQ1sd4mRinf4k4BFox ytzQtugXN4LuvetRRj1bAcjTW4/XNtsEReLxMXDDjnvpSTU7ce6VWmKK//HP7FNeD9gw PwSoGZttlbzDuPtQ/Mri+U5AiOpC4cj43JTZfeHAFo1T4kmZlIMXCFPGkXbYJRa7s3tj psSxGkWSvDQe+mAg1cnCMSudF+G6eadr19OHTBa++1TIV/KA9eeseBIrXkIFWVrnrmlK NXQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=FLzg78V+5RD75KxUUIH66bjiWERUTzBj0XjDutZSRp8=; b=iJmXTlE4BVmZH35DmlyCX4MoU5JmdLCg9lEe2nhiu+M8zKx3ll59taw8wp8IhWetk4 Ny5nyMY1qIOdLpq/ItNYQIG7CmmUkIBCzVjuKt62pn77QHLn2fftXMrDe4M0UxShKa5W qiXul6EKmAJCi9NpcVghCSwpOK4fJNAcJCebMS0UCSAe+Ks49ybsNLdqg/oFKlaev+9h pGki+VGFcdFp7T2DjzPtNCf72N5gvr7u7xx6RiVpAl50Uy6ohOlXao/I5uKzbfDLYtVo E4lrh1k4gW5fBi6aMX54RYhTp220I6/Ew4pvUv7DM5hP3jue7TQNtD5IilvkS/LgxC6z 9CUA== ARC-Authentication-Results: i=1; mx.google.com; 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 p4si3400027ilc.19.2021.09.09.19.50.58; Thu, 09 Sep 2021 19:51:10 -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; 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 S229862AbhIJCvY (ORCPT + 99 others); Thu, 9 Sep 2021 22:51:24 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:58700 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbhIJCvX (ORCPT ); Thu, 9 Sep 2021 22:51:23 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOWa9-002mdU-3p; Fri, 10 Sep 2021 02:48:01 +0000 Date: Fri, 10 Sep 2021 02:48:01 +0000 From: Al Viro To: Jens Axboe Cc: Linus Torvalds , Pavel Begunkov , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [git pull] iov_iter fixes Message-ID: References: <5971af96-78b7-8304-3e25-00dc2da3c538@kernel.dk> <88f83037-0842-faba-b68f-1d4574fb45cb@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <88f83037-0842-faba-b68f-1d4574fb45cb@kernel.dk> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 09, 2021 at 07:35:13PM -0600, Jens Axboe wrote: > Yep ok I follow you now. And yes, if we get a partial one but one that > has more consumed than what was returned, that would not work well. I'm > guessing that a) we've never seen that, or b) we always end up with > either correctly advanced OR fully advanced, and the fully advanced case > would then just return 0 next time and we'd just get a short IO back to > userspace. > > The safer way here would likely be to import the iovec again. We're > still in the context of the original submission, and the sqe hasn't been > consumed in the ring yet, so that can be done safely. ... until you end up with something assuming that you've got the same iovec from userland the second time around. IOW, generally it's a bad idea to do that kind of re-imports.