All of lore.kernel.org
 help / color / mirror / Atom feed
From: iustin@google.com (Iustin Pop)
To: drbd-dev@lists.linbit.com
Subject: [Drbd-dev] Another small patch for guess_dev_name in user/drbdsetup.c (0.7 branch)
Date: Tue, 9 Jan 2007 10:37:47 +0100	[thread overview]
Message-ID: <20070109093747.GC1756@google.com> (raw)

[-- 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;

             reply	other threads:[~2007-01-09  9:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09  9:37 Iustin Pop [this message]
2007-02-16 11:28 ` [Drbd-dev] Another small patch for guess_dev_name in user/drbdsetup.c (0.7 branch) Philipp Reisner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070109093747.GC1756@google.com \
    --to=iustin@google.com \
    --cc=drbd-dev@lists.linbit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.