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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 EA5AEC433FE for ; Fri, 10 Sep 2021 02:50:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C17F36113E for ; Fri, 10 Sep 2021 02:50:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbhIJCvY (ORCPT ); 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-fsdevel@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.