aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/misc.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-10-10 04:08:02 -0400
committerJan Kara <jack@suse.cz>2011-10-10 13:26:24 -0400
commit7e273e3b41e32716dc122b293b5f15635af495ff (patch)
tree5c6735944042e68af4e8681fb424c729701e4957 /fs/udf/misc.c
parent40bfa16dac2adcded9e2eda58246cc3700d97de4 (diff)
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>
Diffstat (limited to 'fs/udf/misc.c')
-rw-r--r--fs/udf/misc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index 9215700c00a4..a85fa7c55b0a 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,
204{ 204{
205 struct tag *tag_p; 205 struct tag *tag_p;
206 struct buffer_head *bh = NULL; 206 struct buffer_head *bh = NULL;
207 u8 checksum;
207 208
208 /* Read the block */ 209 /* Read the block */
209 if (block == 0xFFFFFFFF) 210 if (block == 0xFFFFFFFF)
@@ -211,7 +212,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
211 212
212 bh = udf_tread(sb, block); 213 bh = udf_tread(sb, block);
213 if (!bh) { 214 if (!bh) {
214 udf_debug("block=%d, location=%d: read failed\n", 215 udf_error(sb, __func__, "read failed, block=%u, location=%d\n",
215 block, location); 216 block, location);
216 return NULL; 217 return NULL;
217 } 218 }
@@ -227,15 +228,19 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
227 } 228 }
228 229
229 /* Verify the tag checksum */ 230 /* Verify the tag checksum */
230 if (udf_tag_checksum(tag_p) != tag_p->tagChecksum) { 231 checksum = udf_tag_checksum(tag_p);
231 printk(KERN_ERR "udf: tag checksum failed block %d\n", block); 232 if (checksum != tag_p->tagChecksum) {
233 udf_error(sb, __func__,
234 "tag checksum failed, block %u: 0x%02x != 0x%02x\n",
235 block, checksum, tag_p->tagChecksum);
232 goto error_out; 236 goto error_out;
233 } 237 }
234 238
235 /* Verify the tag version */ 239 /* Verify the tag version */
236 if (tag_p->descVersion != cpu_to_le16(0x0002U) && 240 if (tag_p->descVersion != cpu_to_le16(0x0002U) &&
237 tag_p->descVersion != cpu_to_le16(0x0003U)) { 241 tag_p->descVersion != cpu_to_le16(0x0003U)) {
238 udf_debug("tag version 0x%04x != 0x0002 || 0x0003 block %d\n", 242 udf_error(sb, __func__,
243 "tag version 0x%04x != 0x0002 || 0x0003, block %u\n",
239 le16_to_cpu(tag_p->descVersion), block); 244 le16_to_cpu(tag_p->descVersion), block);
240 goto error_out; 245 goto error_out;
241 } 246 }