Skip to contentSkip to conversation

Another small patch for guess_dev_name in user/drbdsetup.c (0.7 branch)

Drbd-dev Iustin Pop 2 participants 2 messages Jan 9, 2007 – Feb 16, 2007 DRBD driver

lore
Share & tools
lore

Iustin Pop

author
#0 lore raw

Hi,

guess_dev_name can exit early if the major/minor pair passed in is 0,0 as this is not a real device so we won't find it in /dev. This skips recursing over /dev and stat-ing every file.

Attached patch fixes this.

Regards,
Iustin Pop

drbdsetup.c +3 -0
Index: user/drbdsetup.c
===================================================================
@@ -1220,6 +1220,9 @@
   struct stat sb;
   static char dev_name[50];
 
+  if(major==0 && minor==0)
+    return NULL;
+
   device_dir=opendir(dir);
 
   if(!device_dir) goto err_out;
maintainer
#1 lore raw

Am Dienstag, 9. Januar 2007 10:37 schrieb Iustin Pop:

Quoted 6 lines

Hi,

guess_dev_name can exit early if the major/minor pair passed in is 0,0 as this is not a real device so we won't find it in /dev. This skips recursing over /dev and stat-ing every file.

Hi Iustin,

Finally your patches found their way to SVN ;)

http://lists.linbit.com/pipermail/drbd-cvs/2007-February/001466.html

-Phil

Signature · 3 lines
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Vivenotgasse 48, 1120 Vienna, Austria        http://www.linbit.com :