From patchwork Wed Jan 25 21:45:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13116302 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 1F0E2C27C76 for ; Wed, 25 Jan 2023 21:47:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236621AbjAYVrr (ORCPT ); Wed, 25 Jan 2023 16:47:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236196AbjAYVrd (ORCPT ); Wed, 25 Jan 2023 16:47:33 -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 456EB5399B for ; Wed, 25 Jan 2023 13:46:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674683162; 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=mNhSrc58oKovqoZKaTccmmqQuyV6gJD1DBgjwAa2uRY=; b=SA4dOXSKI9TUWCeJGjzrQ/FY3VlHRgYzOxYaHwwNWIMsy5rlZe5P8pc+SyBUDnUd4epaRC bdBxSsS2AjaQfxcs4elm/gRvpg4sjPPqdY+vsSvN6g+4o5ZND7U3gJ/6UECJsnzy4BhmqP AHHg4KpgIS21firfN4SozAoXVu9dKE4= 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-127-l_DeOBGsMxSZpAFYvgJfhw-1; Wed, 25 Jan 2023 16:45:56 -0500 X-MC-Unique: l_DeOBGsMxSZpAFYvgJfhw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9472585CBE0; Wed, 25 Jan 2023 21:45:55 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.33.36.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 963D72026D4B; Wed, 25 Jan 2023 21:45:53 +0000 (UTC) From: David Howells To: Steve French Cc: David Howells , Al Viro , Shyam Prasad N , Rohith Surabattula , Tom Talpey , Stefan Metzmacher , Christoph Hellwig , Matthew Wilcox , Jeff Layton , linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Long Li , Pavel Shilovsky , Ronnie Sahlberg Subject: [RFC 03/13] cifs: Fix oops due to uncleared server->smbd_conn in reconnect Date: Wed, 25 Jan 2023 21:45:33 +0000 Message-Id: <20230125214543.2337639-4-dhowells@redhat.com> In-Reply-To: <20230125214543.2337639-1-dhowells@redhat.com> References: <20230125214543.2337639-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org In smbd_destroy(), clear the server->smbd_conn pointer after freeing the smbd_connection struct that it points to so that reconnection doesn't get confused. Fixes: 8ef130f9ec27 ("CIFS: SMBD: Implement function to destroy a SMB Direct connection") Signed-off-by: David Howells cc: Long Li cc: Steve French cc: Pavel Shilovsky cc: Ronnie Sahlberg cc: linux-cifs@vger.kernel.org --- fs/cifs/smbdirect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 90789aaa6567..8c816b25ce7c 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -1405,6 +1405,7 @@ void smbd_destroy(struct TCP_Server_Info *server) destroy_workqueue(info->workqueue); log_rdma_event(INFO, "rdma session destroyed\n"); kfree(info); + server->smbd_conn = NULL; } /*