* [PATCH] udf: enable error print in udf_read_tagged().
@ 2011-09-27 15:46 Namjae Jeon
2011-09-27 16:18 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Namjae Jeon @ 2011-09-27 15:46 UTC (permalink / raw)
To: jack; +Cc: linux-kernel, Namjae Jeon
While reading metadata, if a problem occurs, Print out only one of the five case.(It also does not show a checksum properly.)
Because Currently it was disable by undef udf_debug.
If there is a problem with scratched disc or loader, the user needs to know which error happened.
Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
---
fs/udf/misc.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index 9215700..82b7ad2 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -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",
+ printk(KERN_ERR "block=%d, location=%d: read failed\n",
block, location);
return NULL;
}
@@ -221,22 +222,24 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
*ident = le16_to_cpu(tag_p->tagIdent);
if (location != le32_to_cpu(tag_p->tagLocation)) {
- udf_debug("location mismatch block %u, tag %u != %u\n",
+ printk(KERN_ERR "location mismatch block %u, tag %u != %u\n",
block, le32_to_cpu(tag_p->tagLocation), location);
goto error_out;
}
/* 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) {
+ printk(KERN_ERR "udf: tag checksum failed block %d, checksum 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",
- le16_to_cpu(tag_p->descVersion), block);
+ printk(KERN_ERR "tag version 0x%04x != 0x0002 || 0x0003 block %d\n",
+ le16_to_cpu(tag_p->descVersion), block);
goto error_out;
}
@@ -247,7 +250,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
le16_to_cpu(tag_p->descCRCLength)))
return bh;
- udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block,
+ printk(KERN_ERR "Crc failure block %d: crc = %d, crclen = %d\n", block,
le16_to_cpu(tag_p->descCRC), le16_to_cpu(tag_p->descCRCLength));
error_out:
--
1.7.4.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] udf: enable error print in udf_read_tagged().
2011-09-27 15:46 [PATCH] udf: enable error print in udf_read_tagged() Namjae Jeon
@ 2011-09-27 16:18 ` Joe Perches
2011-09-28 1:08 ` NamJae Jeon
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2011-09-27 16:18 UTC (permalink / raw)
To: Namjae Jeon; +Cc: jack, linux-kernel
On Wed, 2011-09-28 at 00:46 +0900, Namjae Jeon wrote:
> While reading metadata, if a problem occurs, Print out only one of the five case.(It also does not show a checksum properly.)
[]
> diff --git a/fs/udf/misc.c b/fs/udf/misc.c
[]
> @@ -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",
> + printk(KERN_ERR "block=%d, location=%d: read failed\n",
The other printk in this module uses a "udf: " prefix.
I suggest that
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
is added before any include and these
conversions use pr_err() instead.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] udf: enable error print in udf_read_tagged().
2011-09-27 16:18 ` Joe Perches
@ 2011-09-28 1:08 ` NamJae Jeon
0 siblings, 0 replies; 3+ messages in thread
From: NamJae Jeon @ 2011-09-28 1:08 UTC (permalink / raw)
To: Joe Perches; +Cc: jack, linux-kernel
2011/9/28 Joe Perches <joe@perches.com>:
> On Wed, 2011-09-28 at 00:46 +0900, Namjae Jeon wrote:
>> While reading metadata, if a problem occurs, Print out only one of the five case.(It also does not show a checksum properly.)
> []
>> diff --git a/fs/udf/misc.c b/fs/udf/misc.c
> []
>> @@ -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",
>> + printk(KERN_ERR "block=%d, location=%d: read failed\n",
>
> The other printk in this module uses a "udf: " prefix.
>
> I suggest that
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> is added before any include and these
> conversions use pr_err() instead.
It is good suggestion. I will try to make patch v2 included your suggestion.
Thanks for your review.
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-28 1:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27 15:46 [PATCH] udf: enable error print in udf_read_tagged() Namjae Jeon
2011-09-27 16:18 ` Joe Perches
2011-09-28 1:08 ` NamJae Jeon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®