From 7ac14e3d32a620f29748defa6d8c479a9a32fc81 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 2 Nov 2018 22:19:47 +0100 Subject: [PATCH] label: add stack trace for failing dev_set_last_byte Temporarily add check for failure, but whole function needs to be likely traced for error result. FIXME --- lib/label/label.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/label/label.c b/lib/label/label.c index c92d2cf8d..ca8502d41 100644 --- a/lib/label/label.c +++ b/lib/label/label.c @@ -1341,7 +1341,11 @@ void dev_set_last_byte(struct device *dev, uint64_t offset) unsigned int phys_block_size = 0; unsigned int block_size = 0; - dev_get_block_size(dev, &phys_block_size, &block_size); + if (!dev_get_block_size(dev, &phys_block_size, &block_size)) { + stack; + /* FIXME ASSERT or regular error testing is missing */ + return; + } bcache_set_last_byte(scan_bcache, dev->bcache_fd, offset, phys_block_size); }