From patchwork Fri Oct 28 02:33:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 13022991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18498ECAAA1 for ; Fri, 28 Oct 2022 02:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234327AbiJ1CeO (ORCPT ); Thu, 27 Oct 2022 22:34:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235291AbiJ1CeO (ORCPT ); Thu, 27 Oct 2022 22:34:14 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABEB8BCBAE; Thu, 27 Oct 2022 19:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=ePAnUqBsHfpEZfy8Hk6sJVchTl2kYrXoUq+WAcUoWDA=; b=ZNZOHoy8NsrV2R7T2RHyOEnnLO El93uHcdcPtvooH/1/jUJkhref5Yzh5UUxmkjA8e0CzFFGms4qY80y3yHqrotbI2ObZznWKryK3W8 lvqZOVHceYpxEm24dCbauiXa0BpHEXDgelJRsw1tbSeowLk+UiH43/8BBPikOcVroWqUkToS6snx3 gMr3bs/XQ70IzefyXBqOO0ri4+MoK3C8swTqXFe0U/K2UkoGSyxoiAzEpoVNHbw/cnv11KvRnpJZ5 lmIOUlcr6mxlYpgDkjvFatgSAkzgOjo2/RgTXwm2oULj9LGklOJ6uDFNU1J0XP9JV+pFhGUGurXYh mE4k0MdA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1ooFBx-00EorN-1f; Fri, 28 Oct 2022 02:33:53 +0000 From: Al Viro To: Christoph Hellwig Cc: David Howells , willy@infradead.org, dchinner@redhat.com, Steve French , Shyam Prasad N , Rohith Surabattula , Jeff Layton , Ira Weiny , torvalds@linux-foundation.org, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 08/12] [target] fix iov_iter_bvec() "direction" argument Date: Fri, 28 Oct 2022 03:33:48 +0100 Message-Id: <20221028023352.3532080-8-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221028023352.3532080-1-viro@zeniv.linux.org.uk> References: <20221028023352.3532080-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Signed-off-by: Al Viro --- drivers/target/target_core_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 28aa643be5d5..55935040541b 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -337,7 +337,7 @@ static int fd_do_rw(struct se_cmd *cmd, struct file *fd, len += sg->length; } - iov_iter_bvec(&iter, READ, bvec, sgl_nents, len); + iov_iter_bvec(&iter, is_write, bvec, sgl_nents, len); if (is_write) ret = vfs_iter_write(fd, &iter, &pos, 0); else @@ -473,7 +473,7 @@ fd_execute_write_same(struct se_cmd *cmd) len += se_dev->dev_attrib.block_size; } - iov_iter_bvec(&iter, READ, bvec, nolb, len); + iov_iter_bvec(&iter, WRITE, bvec, nolb, len); ret = vfs_iter_write(fd_dev->fd_file, &iter, &pos, 0); kfree(bvec);