All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edward Shishkin <edward@redhat.com>
To: linux-btrace@vger.kernel.org
Subject: [patch 3/5] blktrace: add back conversion
Date: Tue, 15 Dec 2009 17:47:59 +0000	[thread overview]
Message-ID: <4B27CBCF.8070101@redhat.com> (raw)

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



[-- Attachment #2: blktrace-fix-502889.patch --]
[-- Type: text/plain, Size: 1184 bytes --]

Fixup for bz 502889.

Problem:
when executing with /dev/cciss/foo (long path names)
btreplay complains (No such file or directory).

Bug: 
Missed back conversion of erscores to slashes.

Solution:
Convert underscores to slashes to restore device
names that have larger paths.

Signed-off-by: Edward Shishkin <edward@redhat.com>
---
 btreplay/btreplay.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

--- blktrace.orig/btreplay/btreplay.c
+++ blktrace/btreplay/btreplay.c
@@ -1314,6 +1314,8 @@ static void reset_input_file(struct thr_
  */
 static void *replay_sub(void *arg)
 {
+        int i;
+	char *mdev;
 	char path[MAXPATHLEN];
 	struct io_bunch bunch;
 	struct thr_info *tip = arg;
@@ -1321,8 +1323,15 @@ static void *replay_sub(void *arg)
 
 	pin_to_cpu(tip);
 
-	sprintf(path, "/dev/%s", map_dev(tip->devnm));
-
+	mdev = map_dev(tip->devnm);
+	sprintf(path, "/dev/%s", mdev);
+	/*
+	 * convert underscores to slashes to
+	 * restore device names that have larger paths
+	 */
+	for (i = 0; i < strlen(mdev); i++)
+	        if (path[strlen("/dev/") + i] == '_')
+		        path[strlen("/dev/") + i] = '/';
 #ifdef O_NOATIME
 	oflags = O_NOATIME;
 #else

                 reply	other threads:[~2009-12-15 17:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4B27CBCF.8070101@redhat.com \
    --to=edward@redhat.com \
    --cc=linux-btrace@vger.kernel.org \
    /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.