Fix: statedump block devices OOPS
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 29 May 2014 18:52:53 +0000 (14:52 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 3 Jun 2014 12:35:32 +0000 (08:35 -0400)
Fixes #799

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-statedump-impl.c

index 1bf58ad43d126c8bf0d128f089a01619a6dd05a5..c8ac2d12750d210a11a9c375d2cf0f0aed39e189 100644 (file)
@@ -140,6 +140,14 @@ int lttng_enumerate_block_devices(struct lttng_session *session)
                struct gendisk *disk = dev_to_disk(dev);
                struct hd_struct *part;
 
+               /*
+                * Don't show empty devices or things that have been
+                * suppressed
+                */
+               if (get_capacity(disk) == 0 ||
+                   (disk->flags & GENHD_FL_SUPPRESS_PARTITION_INFO))
+                       continue;
+
                disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0);
                while ((part = disk_part_iter_next(&piter))) {
                        char name_buf[BDEVNAME_SIZE];
This page took 0.026865 seconds and 4 git commands to generate.