[DRBD-cvs] svn commit by lars - r2866 - branches/drbd-0.7/drbd - 2nd part of fix bio leak when Diskless

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Fri Apr 27 13:11:03 CEST 2007


Author: lars
Date: 2007-04-27 13:11:02 +0200 (Fri, 27 Apr 2007)
New Revision: 2866

Modified:
   branches/drbd-0.7/drbd/drbd_req.c
Log:
2nd part of fix bio leak when Diskless

Modified: branches/drbd-0.7/drbd/drbd_req.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_req.c	2007-04-27 11:05:23 UTC (rev 2865)
+++ branches/drbd-0.7/drbd/drbd_req.c	2007-04-27 11:11:02 UTC (rev 2866)
@@ -269,6 +269,10 @@
 		    (volatile int) mdev->cstate > WFBitMapT);
 
 	local = inc_local(mdev);
+	if (!local) {
+		bio_put(req->private_bio); /* or we get a bio leak */
+		req->private_bio = NULL;
+	}
 	NOT_IN_26( if (rw == READA) rw=READ );
 	if (rw == READ || rw == READA) {
 		if (local) {



More information about the drbd-cvs mailing list