diff mbox

[linux-cifs-client] kernel crash - CIFS client unstable on faulty network conditions

Message ID 20091202131835.3f2584bd@tlielax.poochiereds.net (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton Dec. 2, 2009, 6:18 p.m. UTC
None
diff mbox

Patch

From a2d6f76bb2bbc45ab9a534fdfe5c7f1617c0e87a Mon Sep 17 00:00:00 2001
From: Jeff Layton <jlayton@redhat.com>
Date: Wed, 2 Dec 2009 13:16:20 -0500
Subject: [PATCH] cifs: NULL out tcon, pSesInfo, and srvTcp pointers when chasing DFS referrals

The scenario is this:

We've got a valid tcon pointer and we're chasing a DFS referral. We put
the tcon reference, which puts the session reference too. Then we try
the mount again with the new mount info. That mount fails, and we goto
mount_fail_check. The tcon and pSesInfo pointers are non-NULL, but no
longer valid, and things blow up when we try to put references to them.

Fix this by zeroing out the tcon, tcp and smb session pointers before
retrying the mount.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/cifs/connect.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 63ea83f..54f38f1 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2595,6 +2595,9 @@  remote_path_check:
 			else if (pSesInfo)
 				cifs_put_smb_ses(pSesInfo);
 
+			tcon = NULL;
+			pSesInfo = NULL;
+			srvTcp = NULL;
 			cleanup_volume_info(&volume_info);
 			referral_walks_count++;
 			goto try_mount_again;
-- 
1.6.5.2