From patchwork Thu Feb 23 08:15:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 1746676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CU6Z5+zF; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4PMm8f69R9z240V for ; Thu, 23 Feb 2023 19:17:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233593AbjBWIRE (ORCPT ); Thu, 23 Feb 2023 03:17:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233509AbjBWIRB (ORCPT ); Thu, 23 Feb 2023 03:17:01 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D21D74DE11 for ; Thu, 23 Feb 2023 00:15:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677140149; 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=X3ikqoEsv3r0MxS807H4Mv08SZa5kDqPLyNECnlbwYE=; b=CU6Z5+zFcbalFS2dX5FeliL/C6Kb/Q4AwX5yrwPq6Pw8nV1MYMhd5BYtO5qAku2wR3g5pC qyttKQarwPRtWxm1Npp1GJTrEHv8Lw2PxkpRtKZg85PpSPE2BFtWYr5kv7uBFwLG8JcAv1 s1ne7vrTPAlhRKpmLAXh49bDqP2eE+s= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-206-JGOh3xiMO9emvn2N0KPR9g-1; Thu, 23 Feb 2023 03:15:45 -0500 X-MC-Unique: JGOh3xiMO9emvn2N0KPR9g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1009F802C18; Thu, 23 Feb 2023 08:15:45 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id C251F1121314; Thu, 23 Feb 2023 08:15:43 +0000 (UTC) From: David Howells To: Steve French Cc: David Howells , Shyam Prasad N , Rohith Surabattula , Tom Talpey , Stefan Metzmacher , Matthew Wilcox , Jeff Layton , linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, Steve French Subject: [PATCH 1/2] cifs: Add some missing xas_retry() calls Date: Thu, 23 Feb 2023 08:15:38 +0000 Message-Id: <20230223081539.970487-2-dhowells@redhat.com> In-Reply-To: <20230223081539.970487-1-dhowells@redhat.com> References: <20230223081539.970487-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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-cifs@vger.kernel.org The xas_for_each loops added into fs/cifs/file.c need to go round again if indicated by xas_retry(). Fixes: 5f0955c98375 ("cifs: Add some helper functions") Signed-off-by: David Howells cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: Tom Talpey cc: Jeff Layton cc: linux-cifs@vger.kernel.org --- fs/cifs/file.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 0e602173ac76..5c60f4044b65 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -52,6 +52,8 @@ static void cifs_undirty_folios(struct inode *inode, loff_t start, unsigned int end = (start + len - 1) / PAGE_SIZE; xas_for_each_marked(&xas, folio, end, PAGECACHE_TAG_DIRTY) { + if (xas_retry(&xas, folio)) + continue; xas_pause(&xas); rcu_read_unlock(); folio_lock(folio); @@ -81,6 +83,8 @@ void cifs_pages_written_back(struct inode *inode, loff_t start, unsigned int len end = (start + len - 1) / PAGE_SIZE; xas_for_each(&xas, folio, end) { + if (xas_retry(&xas, folio)) + continue; if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", len, start, folio_index(folio), end); @@ -112,6 +116,8 @@ void cifs_pages_write_failed(struct inode *inode, loff_t start, unsigned int len end = (start + len - 1) / PAGE_SIZE; xas_for_each(&xas, folio, end) { + if (xas_retry(&xas, folio)) + continue; if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", len, start, folio_index(folio), end); From patchwork Thu Feb 23 08:15:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 1746675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=g4/o1Rms; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4PMm8d4rtDz240V for ; Thu, 23 Feb 2023 19:17:05 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233584AbjBWIRD (ORCPT ); Thu, 23 Feb 2023 03:17:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233262AbjBWIRA (ORCPT ); Thu, 23 Feb 2023 03:17:00 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11C4B4C6F7 for ; Thu, 23 Feb 2023 00:15:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677140149; 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=AKMYONgMA/W4Xp2CmPvSHz2sn9JYXMHWS8dU6/4wH+A=; b=g4/o1RmsMvdARUQ7kK6k0iEJyTH8/AYsSRG92LwVluCGzYuEr3VH8ia/fyQe7siaIX2fv1 bQxZiGmGkMpjT1d0JO2bb03ceJniZplnBdLo4AOsgbFLTNDOSoGhcMyi7G6bAsBdKvuD2V cv3yoR0EbwFORhsFm3KEwrp5NT6yj/Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-157-BOzk5WYFOVe9tUA_9GNWYA-1; Thu, 23 Feb 2023 03:15:47 -0500 X-MC-Unique: BOzk5WYFOVe9tUA_9GNWYA-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 04A3F85A588; Thu, 23 Feb 2023 08:15:47 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DD0840C1423; Thu, 23 Feb 2023 08:15:45 +0000 (UTC) From: David Howells To: Steve French Cc: David Howells , Shyam Prasad N , Rohith Surabattula , Tom Talpey , Stefan Metzmacher , Matthew Wilcox , Jeff Layton , linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, Steve French , linux-rdma@vger.kernel.org Subject: [PATCH 2/2] cifs: Fix an uninitialised variable Date: Thu, 23 Feb 2023 08:15:39 +0000 Message-Id: <20230223081539.970487-3-dhowells@redhat.com> In-Reply-To: <20230223081539.970487-1-dhowells@redhat.com> References: <20230223081539.970487-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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-cifs@vger.kernel.org Fix an uninitialised variable introduced in cifs. Fixes: 3d78fe73fa12 ("cifs: Build the RDMA SGE list directly from an iterator") Signed-off-by: David Howells cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: Tom Talpey cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: linux-rdma@vger.kernel.org --- fs/cifs/smbdirect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 55b6e319a61d..0362ebd4fa0f 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -837,7 +837,7 @@ static int smbd_post_send_iter(struct smbd_connection *info, int data_length; struct smbd_request *request; struct smbd_data_transfer *packet; - int new_credits; + int new_credits = 0; wait_credit: /* Wait for send credits. A SMBD packet needs one credit */