From patchwork Fri Oct 28 02:33:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp576532wru; Thu, 27 Oct 2022 19:38:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75GPcQMNiLNUoHttBVEaEOqyajd/VwLlHR6THvXMfU7DmCi9LJzVqXyztrvXOQNdvMum3t X-Received: by 2002:a50:9992:0:b0:461:6cde:ccdd with SMTP id m18-20020a509992000000b004616cdeccddmr29845728edb.402.1666924714807; Thu, 27 Oct 2022 19:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666924714; cv=none; d=google.com; s=arc-20160816; b=YeCe+75IEX0v+7Hh7Sinml8YTS4ERAjCyTuRBZmk50GIfIT7nIY1d6QjMrnYFWrgPS 3Z0A+jNBP83COke6bsBgUE0LpXghGy5RVBcQ475YEow+FN/0nYRjMz5tcI/HLGivC0IX UVXnsVRsceMjPYdUZD6IKqQyoNdESc4ACR+7YLcm55AjvBuZzLBYqPDa5tnlrNF9kF5D pUKfJq81EWWjCrVOvpvT0LQplVrUQP3LxMAjkJGL3FOUJTUQNpeuqWF4YE/3Hd6QrmiY wiMUkNKEFTvvY8iH8lEMm3cCJr4Lr5UiemwH5SFUaU8MDOI+pLEKcHhwejlWbP4PdJLA wxMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qufNA/5kQeMMQSclQfaUC/Q9jzBAxgNcm9w2RfpdC1I=; b=qtmKjRIXVme3ye1+MIYkqvFMh3ZqZaXmgbHr/I6D19Edm4D+cJTpKRsE6t42E107/H zH+EDD1j3KbOq52jjbq0Le+4q2DeD3FG0qfBtLZBYlRTESxr7gtB2RNX3idC18TjNTTu ZHIIuoLx6Eqsw/30Bh6DtPmOCY819FWFml0NLUXNA+TMlvqRMWppaWATGMRANbxARASc JjrReeeqrGdOprxt58HwTfq6eHXhDJu7tXdfjzji3hT3RQj0CHmF8kzGYfPeIDg4saez Y/LsUA44adKlyLNmKplmSl2l2bePbQZeS1i6/MszdAtBVOUrODwiA6oIDXg/eU9ZY1k9 sbwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=guEjN2nc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020a50cd8a000000b004588172def1si3449104edi.410.2022.10.27.19.38.11; Thu, 27 Oct 2022 19:38:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=guEjN2nc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236531AbiJ1CfF (ORCPT + 99 others); Thu, 27 Oct 2022 22:35:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236213AbiJ1CeP (ORCPT ); Thu, 27 Oct 2022 22:34:15 -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 C5349BD67D; Thu, 27 Oct 2022 19:34:14 -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=qufNA/5kQeMMQSclQfaUC/Q9jzBAxgNcm9w2RfpdC1I=; b=guEjN2ncL7ybD6mN2yx+05P8sw XwP2uFN1PVlpY4ZzDcfii84vlnSN1VSAo/tpAQJoF2GuJKshqphLeM2R/nM3vG5+AtaN85pL9Dbi9 /RPox8fe5y3FrfZYK3uSKQa958CWZusW11/VVwuUoU4arCks/52vWugnPgi+QzjJa5DYotpvFjMQr RDzpQzxR2gGQBITEXWoLQ/gPvDGPrZUQsgzQQhKIqa52CLvkoi6P0/e2ZTO3wbISFfUliClgtW1K0 mJ9vrkQDxsJ3QvwGykpn4y7WjFVBdMltqn/h/CVTLJmatfGdy0Eav8p6fUXwTNg+CAvu0gZjnTrC6 QCg24Fpw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1ooFBx-00EorR-2n; 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 10/12] [xen] fix "direction" argument of iov_iter_kvec() Date: Fri, 28 Oct 2022 03:33:50 +0100 Message-Id: <20221028023352.3532080-10-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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747897249561920658?= X-GMAIL-MSGID: =?utf-8?q?1747897249561920658?= Signed-off-by: Al Viro --- drivers/xen/pvcalls-back.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c index d6f945fd4147..21b9c850a382 100644 --- a/drivers/xen/pvcalls-back.c +++ b/drivers/xen/pvcalls-back.c @@ -129,13 +129,13 @@ static bool pvcalls_conn_back_read(void *opaque) if (masked_prod < masked_cons) { vec[0].iov_base = data->in + masked_prod; vec[0].iov_len = wanted; - iov_iter_kvec(&msg.msg_iter, WRITE, vec, 1, wanted); + iov_iter_kvec(&msg.msg_iter, READ, vec, 1, wanted); } else { vec[0].iov_base = data->in + masked_prod; vec[0].iov_len = array_size - masked_prod; vec[1].iov_base = data->in; vec[1].iov_len = wanted - vec[0].iov_len; - iov_iter_kvec(&msg.msg_iter, WRITE, vec, 2, wanted); + iov_iter_kvec(&msg.msg_iter, READ, vec, 2, wanted); } atomic_set(&map->read, 0); @@ -188,13 +188,13 @@ static bool pvcalls_conn_back_write(struct sock_mapping *map) if (pvcalls_mask(prod, array_size) > pvcalls_mask(cons, array_size)) { vec[0].iov_base = data->out + pvcalls_mask(cons, array_size); vec[0].iov_len = size; - iov_iter_kvec(&msg.msg_iter, READ, vec, 1, size); + iov_iter_kvec(&msg.msg_iter, WRITE, vec, 1, size); } else { vec[0].iov_base = data->out + pvcalls_mask(cons, array_size); vec[0].iov_len = array_size - pvcalls_mask(cons, array_size); vec[1].iov_base = data->out; vec[1].iov_len = size - vec[0].iov_len; - iov_iter_kvec(&msg.msg_iter, READ, vec, 2, size); + iov_iter_kvec(&msg.msg_iter, WRITE, vec, 2, size); } atomic_set(&map->write, 0);