dm cache metadata: name the cache block that couldn't be loaded
authorMike Snitzer <snitzer@redhat.com>
Tue, 4 Oct 2016 19:22:17 +0000 (15:22 -0400)
committerMike Snitzer <snitzer@redhat.com>
Thu, 16 Feb 2017 18:12:48 +0000 (13:12 -0500)
Improves __load_mapping_v1() and __load_mapping_v2() DMERR messages to
explicitly name the cache block number whose mapping couldn't be
loaded.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-cache-metadata.c

index 0610be7846dc4d5da545fe4cd1a979ecd0794d8d..5a5ef996a26a7baa80b8fed217d89f6c1d8aad34 100644 (file)
@@ -1316,8 +1316,10 @@ static int __load_mapping_v1(struct dm_cache_metadata *cmd,
 
                r = fn(context, oblock, to_cblock(cb), flags & M_DIRTY,
                       le32_to_cpu(hint), hints_valid);
-               if (r)
-                       DMERR("policy couldn't load cblock");
+               if (r) {
+                       DMERR("policy couldn't load cache block %llu",
+                             (unsigned long long) from_cblock(to_cblock(cb)));
+               }
        }
 
        return r;
@@ -1355,8 +1357,10 @@ static int __load_mapping_v2(struct dm_cache_metadata *cmd,
                dirty = dm_bitset_cursor_get_value(dirty_cursor);
                r = fn(context, oblock, to_cblock(cb), dirty,
                       le32_to_cpu(hint), hints_valid);
-               if (r)
-                       DMERR("policy couldn't load cblock");
+               if (r) {
+                       DMERR("policy couldn't load cache block %llu",
+                             (unsigned long long) from_cblock(to_cblock(cb)));
+               }
        }
 
        return r;