* [patch 1/5] blktrace: avoid device duplication
@ 2009-12-15 17:47 Edward Shishkin
2009-12-15 20:49 ` Eric Sandeen
0 siblings, 1 reply; 2+ messages in thread
From: Edward Shishkin @ 2009-12-15 17:47 UTC (permalink / raw)
To: linux-btrace
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: blktrace-fix-501457.patch --]
[-- Type: text/plain, Size: 1021 bytes --]
Fixup for bz 501457.
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 1/5] blktrace: avoid device duplication
2009-12-15 17:47 [patch 1/5] blktrace: avoid device duplication Edward Shishkin
@ 2009-12-15 20:49 ` Eric Sandeen
0 siblings, 0 replies; 2+ messages in thread
From: Eric Sandeen @ 2009-12-15 20:49 UTC (permalink / raw)
To: linux-btrace
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-15 20:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-15 17:47 [patch 1/5] blktrace: avoid device duplication Edward Shishkin
2009-12-15 20:49 ` Eric Sandeen
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.