From patchwork Fri Jun 30 15:25:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13298358 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66F0BEB64DC for ; Fri, 30 Jun 2023 15:25:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA3D38E0024; Fri, 30 Jun 2023 11:25:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D2E0E8E000F; Fri, 30 Jun 2023 11:25:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B319E8E0024; Fri, 30 Jun 2023 11:25:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 99E818E000F for ; Fri, 30 Jun 2023 11:25:57 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 71F58140E2B for ; Fri, 30 Jun 2023 15:25:57 +0000 (UTC) X-FDA: 80959789554.26.1205CC0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 5DFE92001E for ; Fri, 30 Jun 2023 15:25:55 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YHvs6nfM; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf03.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688138755; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7s8hoY7EpXAbXFSpowadN1tdtKV1KZLtOvJuBTKdpmw=; b=usIYz6PXTuOEZCt4zTSWy1hKGtMGP0y2WBuN3WlLmunBCCN3jlq2Z0537RsRkc7N+eznig P7h/5Hr7u131SZgxjOdx8a5BhRn6e6lMLT1KDz9P+S/omip5oDu+Xtk0mFHqNVJ7wW44o2 3q5Tzr8Hwtw5XvBa3uH+QEt0XsRfZ8Y= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YHvs6nfM; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf03.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688138755; a=rsa-sha256; cv=none; b=qz/62v9XtGp9jRZhlUOTDxps7Wr75NXwndYw/8oQmyZXWefsBO6+LMvikVfVSt26oNPu8X FGVwjv+QAiSv3BPfqIijbzltrMQnr3dJ/Rf1SsL5v80xWoZO9UhV0iIJUSGKAQnWHCmWRP qww3o7RmkS3Z3AcFApD5OwI1WCx44F8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688138754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7s8hoY7EpXAbXFSpowadN1tdtKV1KZLtOvJuBTKdpmw=; b=YHvs6nfMrlelXUUxOaaac9F8Jb2zDHjntPQXJCj6OETiVTBEw/8F26hZWlpmMy04LlVlPr jrQMvZV4XHp93HfE41C3W6f55gYf81dM3wCmNFTfR86QPUESuYi6Am71SMpRitNTVhjEWq r0qGVSSOCMYLmEYBx5zhx5lpWxqstdQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-338-Zp02hgoBNIOVX0nerBYChA-1; Fri, 30 Jun 2023 11:25:50 -0400 X-MC-Unique: Zp02hgoBNIOVX0nerBYChA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C5C23C0E456; Fri, 30 Jun 2023 15:25:49 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18E074087C6A; Fri, 30 Jun 2023 15:25:45 +0000 (UTC) From: David Howells To: Jens Axboe , Al Viro , Christoph Hellwig Cc: David Howells , Matthew Wilcox , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Christoph Hellwig , Christian Brauner , linux-cifs@vger.kernel.org Subject: [RFC PATCH 07/11] cifs: Drop the check using iov_iter_rw() Date: Fri, 30 Jun 2023 16:25:20 +0100 Message-ID: <20230630152524.661208-8-dhowells@redhat.com> In-Reply-To: <20230630152524.661208-1-dhowells@redhat.com> References: <20230630152524.661208-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Rspam-User: X-Stat-Signature: ra17csc4pnhyc4m9w1cx346qbzjznxhj X-Rspamd-Server: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0Pdc1rH0PCfWCMSIGQMpZmOyis/S7XbE1sUfVnOlXRfVyn/jzy4yVm3AOS9wpWle69Hk8Tl3cP+IJ7xH11C7SzTqJiLSzD/R1qQAGr+HERXAlix2JI0Z07oQQv23ytw38Wcdr4C7gusN74eZxVj+a/c40GFqGKOAI+VsFUYrt6FozvMEEnYrRK1KB3GkpIJEBCIAdRIgg6d371LHlQXOiW1JOw0jYiDpmvkhO4Hf7lvcNehhCXs3MabJ/xFP2VO3vyGWn9cyCF336CxHjeIYDBaQOjIWPMuwMZ6iLHa0S7m7bCiXaH9wlREzgUwrvdIvP5yDpA9PvSHflHGgbeYrcVKNDDxt9doR/AhUoVgmybOBGS3kgsNMUx3bynms5BsCNfQ0lrG7xo7DthhBEkmz41h1YpyLT5TsxdbtuMgUPZ5rc5zt4u5Xv5Ha7ZCdq X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: smbd_recv() has a check that the iterator is the correct direction. Drop this check as we're getting rid of iov_iter_rw(). Signed-off-by: David Howells cc: Steve French cc: Paulo Alcantara cc: Ronnie Sahlberg cc: Shyam Prasad N cc: Tom Talpey cc: Christoph Hellwig cc: Jens Axboe cc: Christian Brauner cc: Alexander Viro cc: linux-cifs@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org --- fs/smb/client/smbdirect.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index 223e17c16b60..672078d00207 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -1906,14 +1906,6 @@ int smbd_recv(struct smbd_connection *info, struct msghdr *msg) unsigned int to_read, page_offset; int rc; - if (iov_iter_rw(&msg->msg_iter) == WRITE) { - /* It's a bug in upper layer to get there */ - cifs_dbg(VFS, "Invalid msg iter dir %u\n", - iov_iter_rw(&msg->msg_iter)); - rc = -EINVAL; - goto out; - } - switch (iov_iter_type(&msg->msg_iter)) { case ITER_KVEC: buf = msg->msg_iter.kvec->iov_base; @@ -1935,7 +1927,6 @@ int smbd_recv(struct smbd_connection *info, struct msghdr *msg) rc = -EINVAL; } -out: /* SMBDirect will read it all or nothing */ if (rc > 0) msg->msg_iter.count = 0;