Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1740004pxb; Thu, 16 Sep 2021 14:29:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnyD5j+whHtJ6GpLCEVahcZADWpn3SGg581l0PjNP6mVK8EqkA7zgLxgriJGr65I+6h18r X-Received: by 2002:a17:906:1c99:: with SMTP id g25mr8304844ejh.521.1631827752200; Thu, 16 Sep 2021 14:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631827752; cv=none; d=google.com; s=arc-20160816; b=LtvCYqWjfXrWUwu4IFZwFqobkHjEV3I3VIK/gqHmS9X080OAXK2benQzQydzpK/PHf cjFN7YOorEiX4ctOTLPf/+Ln6ZTIdigDd3/NgI0pXopSayL2btnF+pNItp8zY3VUF8xQ JQyPGNyOsfK9xtRO/xHQyoESp4cJgdbw4FbNjXuNC7/MFUREceJc1LtlvECmHMQmKEqQ SCmXbR9h4t9fyZlOjNwQsGNc1UyKX8TEtoILRG9UaIxkJyAnYmXj+I6hD7Lfj6acQz9q J9Xe3Hrqqv9DrNN9HbyiuSXi9cdajc+4hi616VbxPKRLqLuifvEIJNFICrdsriO5aPOj iIbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9m8XrD+rzwkvy+UK0K5ghfFmRll88EZwOtuNWb1nWRk=; b=OxTrNDXwETRPFj1vMoQEFEUFqLMcBscZ1WnwpK99+kIyBCX48QOQNWuJFm11kyi+GO 4mKbDWLOFhRYBC+df2v+l/63JTvdIfceE5SGTOJp0RS8yzwAqTlaCCKMq8vOomRMWhHP NkX7bv4fjAiIjbxruMm91JBSLTsyrr5uwM3YPsoQtWmLhUp93W7xyvT+OpckCTnHZMBl zvAhgLp5hPCNSEv69loY8onJVD3FHkX51byrtstWyYCWVP1LrTa6UiJrz15MkEorVI2X lPB1FjiNoCa7OleXQESKxPhKmuIQJm2jjzRbmGj87b14nhA8ph8qHtzenAS0C0DqbhQT +WIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t3A1okUu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j93si5045184edc.193.2021.09.16.14.28.47; Thu, 16 Sep 2021 14:29:12 -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=@linuxfoundation.org header.s=korg header.b=t3A1okUu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243397AbhIPQbZ (ORCPT + 99 others); Thu, 16 Sep 2021 12:31:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:59264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241921AbhIPQXW (ORCPT ); Thu, 16 Sep 2021 12:23:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 70A5F61501; Thu, 16 Sep 2021 16:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808942; bh=bkT8Ib29D0PmBO6CIcRjFAwjuMQvPjyTaYdr8R8O6is=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t3A1okUusnrLleCIt6iChhOxoWcodkk0ca8CNxyctrNuyRMSISAKnYKCw+tbdD/93 tKkxTGhuOTX1kD7rPFGWRl1wX/RdsA1k0ll22w+rei8P5rC8uXIANPnqo6dc0v8TuH 4tB7m3QPVC2L2goU2AUo9xIsNiN74L1FFpK+n1hA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Laight , Pavel Begunkov , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 278/306] fs/io_uring Dont use the return value from import_iovec(). Date: Thu, 16 Sep 2021 18:00:23 +0200 Message-Id: <20210916155803.557131514@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Laight [ Upstream commit 10fc72e43352753a08f9cf83aa5c40baec00d212 ] This is the only code that relies on import_iovec() returning iter.count on success. This allows a better interface to import_iovec(). Signed-off-by: David Laight Signed-off-by: Pavel Begunkov Reviewed-by: Pavel Begunkov Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/io_uring.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 6978a42fa39b..8de0f52fd29d 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3128,7 +3128,7 @@ static ssize_t __io_import_iovec(int rw, struct io_kiocb *req, ret = import_single_range(rw, buf, sqe_len, *iovec, iter); *iovec = NULL; - return ret < 0 ? ret : sqe_len; + return ret; } if (req->flags & REQ_F_BUFFER_SELECT) { @@ -3154,7 +3154,7 @@ static ssize_t io_import_iovec(int rw, struct io_kiocb *req, if (!iorw) return __io_import_iovec(rw, req, iovec, iter, needs_lock); *iovec = NULL; - return iov_iter_count(&iorw->iter); + return 0; } static inline loff_t *io_kiocb_ppos(struct kiocb *kiocb) @@ -3423,7 +3423,7 @@ static int io_read(struct io_kiocb *req, bool force_nonblock, if (ret < 0) return ret; iov_count = iov_iter_count(iter); - io_size = ret; + io_size = iov_count; req->result = io_size; ret = 0; @@ -3552,7 +3552,7 @@ static int io_write(struct io_kiocb *req, bool force_nonblock, if (ret < 0) return ret; iov_count = iov_iter_count(iter); - io_size = ret; + io_size = iov_count; req->result = io_size; /* Ensure we clear previously set non-block flag */ -- 2.30.2