dm table: print error on preresume failure
authorMike Snitzer <snitzer@redhat.com>
Thu, 24 Oct 2013 18:10:29 +0000 (14:10 -0400)
committerMike Snitzer <snitzer@redhat.com>
Sat, 9 Nov 2013 23:20:21 +0000 (18:20 -0500)
If preresume fails it is worth logging an error given that a device is
left suspended due to the failure.

This change was motivated by local preresume error logging that was
added to the cache target ("preresume failed").  Elevating this
target-agnostic context for the where the target-specific error occurred
relative to the DM core's callouts makes sense.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Joe Thornber <ejt@redhat.com>
drivers/md/dm-table.c

index 41d907b58f7e10fba58aab9d01354a6a581c3d9e..465f08ca62b1e355f8fd776fac4a6159d79a1a2e 100644 (file)
@@ -1562,8 +1562,11 @@ int dm_table_resume_targets(struct dm_table *t)
                        continue;
 
                r = ti->type->preresume(ti);
-               if (r)
+               if (r) {
+                       DMERR("%s: %s: preresume failed, error = %d",
+                             dm_device_name(t->md), ti->type->name, r);
                        return r;
+               }
        }
 
        for (i = 0; i < t->num_targets; i++) {