All of lore.kernel.org
 help / color / mirror / Atom feed
* [Drbd-dev] Another small patch for guess_dev_name in user/drbdsetup.c (0.7 branch)
@ 2007-01-09  9:37 Iustin Pop
  2007-02-16 11:28 ` Philipp Reisner
  0 siblings, 1 reply; 2+ messages in thread
From: Iustin Pop @ 2007-01-09  9:37 UTC (permalink / raw)
  To: drbd-dev

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

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

[-- Attachment #2: null-device.patch --]
[-- Type: text/plain, Size: 348 bytes --]

Index: user/drbdsetup.c
===================================================================
--- user/drbdsetup.c	(revision 2659)
+++ user/drbdsetup.c	(working copy)
@@ -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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-16 11:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-09  9:37 [Drbd-dev] Another small patch for guess_dev_name in user/drbdsetup.c (0.7 branch) Iustin Pop
2007-02-16 11:28 ` Philipp Reisner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.