udf: Promote some debugging messages to udf_error
If there is a problem with a scratched disc or loader, it's valuable to know which error occurred. Convert some debug messages to udf_error, neaten those messages too. Add the calculated tag checksum and the read checksum to error message. Make udf_error a public function and move the logging prototypes together. Original-patch-by: NamJae Jeon <linkinjeon@gmail.com> Reviewed-by: NamJae Jeon <linkinjeon@gmail.com> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
@@ -204,6 +204,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
|
||||
{
|
||||
struct tag *tag_p;
|
||||
struct buffer_head *bh = NULL;
|
||||
u8 checksum;
|
||||
|
||||
/* Read the block */
|
||||
if (block == 0xFFFFFFFF)
|
||||
@@ -211,7 +212,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
|
||||
|
||||
bh = udf_tread(sb, block);
|
||||
if (!bh) {
|
||||
udf_debug("block=%d, location=%d: read failed\n",
|
||||
udf_error(sb, __func__, "read failed, block=%u, location=%d\n",
|
||||
block, location);
|
||||
return NULL;
|
||||
}
|
||||
@@ -227,15 +228,19 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
|
||||
}
|
||||
|
||||
/* Verify the tag checksum */
|
||||
if (udf_tag_checksum(tag_p) != tag_p->tagChecksum) {
|
||||
printk(KERN_ERR "udf: tag checksum failed block %d\n", block);
|
||||
checksum = udf_tag_checksum(tag_p);
|
||||
if (checksum != tag_p->tagChecksum) {
|
||||
udf_error(sb, __func__,
|
||||
"tag checksum failed, block %u: 0x%02x != 0x%02x\n",
|
||||
block, checksum, tag_p->tagChecksum);
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
/* Verify the tag version */
|
||||
if (tag_p->descVersion != cpu_to_le16(0x0002U) &&
|
||||
tag_p->descVersion != cpu_to_le16(0x0003U)) {
|
||||
udf_debug("tag version 0x%04x != 0x0002 || 0x0003 block %d\n",
|
||||
udf_error(sb, __func__,
|
||||
"tag version 0x%04x != 0x0002 || 0x0003, block %u\n",
|
||||
le16_to_cpu(tag_p->descVersion), block);
|
||||
goto error_out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user