[DRBD-cvs] svn commit by phil - r2789 - trunk/drbd - Hmm, this was a leftover from our Linux-2.4.x days. Sin

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Fri Mar 9 11:14:11 CET 2007


Author: phil
Date: 2007-03-09 11:14:10 +0100 (Fri, 09 Mar 2007)
New Revision: 2789

Modified:
   trunk/drbd/drbd_nl.c
Log:
Hmm, this was a leftover from our Linux-2.4.x days. Since 2.6 the 
returncode of filp_open() has to be checked with the IS_ERR() macro.



Modified: trunk/drbd/drbd_nl.c
===================================================================
--- trunk/drbd/drbd_nl.c	2007-03-09 08:51:36 UTC (rev 2788)
+++ trunk/drbd/drbd_nl.c	2007-03-09 10:14:10 UTC (rev 2789)
@@ -714,7 +714,10 @@
 	}
 
 	nbc->lo_file = filp_open(nbc->dc.backing_dev,O_RDWR,0);
-	if (!nbc->lo_file) {
+	if (IS_ERR(nbc->lo_file)) {
+		ERR("open(\"%s\") failed with %ld\n", nbc->dc.backing_dev,
+		    PTR_ERR(nbc->lo_file));
+		nbc->lo_file=NULL;
 		retcode=LDNameInvalid;
 		goto fail;
 	}
@@ -727,8 +730,10 @@
 	}
 
 	nbc->md_file = filp_open(nbc->dc.meta_dev,O_RDWR,0);
-
-	if (!nbc->md_file) {
+	if (IS_ERR(nbc->md_file)) {
+		ERR("open(\"%s\") failed with %ld\n", nbc->dc.meta_dev,
+		    PTR_ERR(nbc->md_file));
+		nbc->md_file=NULL;
 		retcode=MDNameInvalid;
 		goto fail;
 	}



More information about the drbd-cvs mailing list