linux-btrace.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: linux-btrace@vger.kernel.org
Subject: Re: [patch 1/5] blktrace: avoid device duplication
Date: Tue, 15 Dec 2009 20:49:50 +0000	[thread overview]
Message-ID: <4B27F66E.5000607@redhat.com> (raw)
In-Reply-To: <4B27CBC3.8040602@redhat.com>

Edward Shishkin wrote:
> 
> Fixup for bz 501457.

Just to be clear, these are Red Hat bugzilla numbers, i.e.

https://bugzilla.redhat.com/show_bug.cgi?idP1457

Thanks,
-Eric

> Problem:
> If the device list file contains the same device
> as supplied on the command line, blktrace stops
> immediately and further I/O tracing is impossible.
> 
> Bug: device duplication in the devpaths ends with
> programm termination (BLKTRACESETUP ioctl returns
> error) while resources (open files in debugfs) are
> not released.
> 
> Solution:
> Make sure devices are not duplicated in devpaths
> pool.
> 
> Signed-off-by: Edward Shishkin <edward@redhat.com>
> ---
>  blktrace.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> --- blktrace.orig/blktrace.c
> +++ blktrace/blktrace.c
> @@ -1200,8 +1200,17 @@ static int add_devpath(char *path)
>  {
>  	int fd;
>  	struct devpath *dpp;
> +	struct list_head *p;
>  
>  	/*
> +	 * Verify device is not duplicated
> +	 */
> +	__list_for_each(p, &devpaths) {
> +	       struct devpath *tmp = list_entry(p, struct devpath, head);
> +	       if (!strcmp(tmp->path, path))
> +		        return 0;
> +	}
> +	/*
>  	 * Verify device is valid before going too far
>  	 */
>  	fd = my_open(path, O_RDONLY | O_NONBLOCK);


      reply	other threads:[~2009-12-15 20:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 17:47 [patch 1/5] blktrace: avoid device duplication Edward Shishkin
2009-12-15 20:49 ` Eric Sandeen [this message]

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=4B27F66E.5000607@redhat.com \
    --to=sandeen@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).