[PATCH] smbd: Fix a 100% loop at shutdown time

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Jul 11 08:27:57 MDT 2013


Hi!

Please review&push. This will probably also be a 4.0 bug.

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 299a447bfd539c205086fc6886bd39f8f6248bec Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 11 Jul 2013 16:22:26 +0200
Subject: [PATCH] smbd: Fix a 100% loop at shutdown time

In the destructor of fsp->aio_requests[0] we put another request into
fsp->aio_requests[0]. Don't overwrite that with TALLOC_FREE.

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/smbd/close.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 2bd588b..f341c72 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -640,9 +640,12 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp,
 		while (fsp->num_aio_requests != 0) {
 			/*
 			 * The destructor of the req will remove
-			 * itself from the fsp
+			 * itself from the fsp.
+			 * Don't use TALLOC_FREE here, this will overwrite
+			 * what the destructor just wrote into
+			 * aio_requests[0].
 			 */
-			TALLOC_FREE(fsp->aio_requests[0]);
+			talloc_free(fsp->aio_requests[0]);
 		}
 	}
 
-- 
1.7.9.5



More information about the samba-technical mailing list