aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hpfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hpfs/super.c')
-rw-r--r--fs/hpfs/super.c55
1 files changed, 32 insertions, 23 deletions
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index fe3463a43236..e229b3f187cf 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -62,22 +62,26 @@ void hpfs_error(struct super_block *s, const char *fmt, ...)
62 vsnprintf(err_buf, sizeof(err_buf), fmt, args); 62 vsnprintf(err_buf, sizeof(err_buf), fmt, args);
63 va_end(args); 63 va_end(args);
64 64
65 printk("HPFS: filesystem error: %s", err_buf); 65 pr_err("HPFS: filesystem error: %s", err_buf);
66 if (!hpfs_sb(s)->sb_was_error) { 66 if (!hpfs_sb(s)->sb_was_error) {
67 if (hpfs_sb(s)->sb_err == 2) { 67 if (hpfs_sb(s)->sb_err == 2) {
68 printk("; crashing the system because you wanted it\n"); 68 pr_cont("; crashing the system because you wanted it\n");
69 mark_dirty(s, 0); 69 mark_dirty(s, 0);
70 panic("HPFS panic"); 70 panic("HPFS panic");
71 } else if (hpfs_sb(s)->sb_err == 1) { 71 } else if (hpfs_sb(s)->sb_err == 1) {
72 if (s->s_flags & MS_RDONLY) printk("; already mounted read-only\n"); 72 if (s->s_flags & MS_RDONLY)
73 pr_cont("; already mounted read-only\n");
73 else { 74 else {
74 printk("; remounting read-only\n"); 75 pr_cont("; remounting read-only\n");
75 mark_dirty(s, 0); 76 mark_dirty(s, 0);
76 s->s_flags |= MS_RDONLY; 77 s->s_flags |= MS_RDONLY;
77 } 78 }
78 } else if (s->s_flags & MS_RDONLY) printk("; going on - but anything won't be destroyed because it's read-only\n"); 79 } else if (s->s_flags & MS_RDONLY)
79 else printk("; corrupted filesystem mounted read/write - your computer will explode within 20 seconds ... but you wanted it so!\n"); 80 pr_cont("; going on - but anything won't be destroyed because it's read-only\n");
80 } else printk("\n"); 81 else
82 pr_cont("; corrupted filesystem mounted read/write - your computer will explode within 20 seconds ... but you wanted it so!\n");
83 } else
84 pr_cont("\n");
81 hpfs_sb(s)->sb_was_error = 1; 85 hpfs_sb(s)->sb_was_error = 1;
82} 86}
83 87
@@ -292,7 +296,7 @@ static int parse_opts(char *opts, kuid_t *uid, kgid_t *gid, umode_t *umask,
292 if (!opts) 296 if (!opts)
293 return 1; 297 return 1;
294 298
295 /*printk("Parsing opts: '%s'\n",opts);*/ 299 /*pr_info("Parsing opts: '%s'\n",opts);*/
296 300
297 while ((p = strsep(&opts, ",")) != NULL) { 301 while ((p = strsep(&opts, ",")) != NULL) {
298 substring_t args[MAX_OPT_ARGS]; 302 substring_t args[MAX_OPT_ARGS];
@@ -387,7 +391,7 @@ static int parse_opts(char *opts, kuid_t *uid, kgid_t *gid, umode_t *umask,
387 391
388static inline void hpfs_help(void) 392static inline void hpfs_help(void)
389{ 393{
390 printk("\n\ 394 pr_info("\n\
391HPFS filesystem options:\n\ 395HPFS filesystem options:\n\
392 help do not mount and display this text\n\ 396 help do not mount and display this text\n\
393 uid=xxx set uid of files that don't have uid specified in eas\n\ 397 uid=xxx set uid of files that don't have uid specified in eas\n\
@@ -434,7 +438,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
434 438
435 if (!(o = parse_opts(data, &uid, &gid, &umask, &lowercase, 439 if (!(o = parse_opts(data, &uid, &gid, &umask, &lowercase,
436 &eas, &chk, &errs, &chkdsk, &timeshift))) { 440 &eas, &chk, &errs, &chkdsk, &timeshift))) {
437 printk("HPFS: bad mount options.\n"); 441 pr_warn("HPFS: bad mount options.\n");
438 goto out_err; 442 goto out_err;
439 } 443 }
440 if (o == 2) { 444 if (o == 2) {
@@ -442,7 +446,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
442 goto out_err; 446 goto out_err;
443 } 447 }
444 if (timeshift != sbi->sb_timeshift) { 448 if (timeshift != sbi->sb_timeshift) {
445 printk("HPFS: timeshift can't be changed using remount.\n"); 449 pr_warn("HPFS: timeshift can't be changed using remount.\n");
446 goto out_err; 450 goto out_err;
447 } 451 }
448 452
@@ -523,7 +527,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
523 527
524 if (!(o = parse_opts(options, &uid, &gid, &umask, &lowercase, 528 if (!(o = parse_opts(options, &uid, &gid, &umask, &lowercase,
525 &eas, &chk, &errs, &chkdsk, &timeshift))) { 529 &eas, &chk, &errs, &chkdsk, &timeshift))) {
526 printk("HPFS: bad mount options.\n"); 530 pr_warn("HPFS: bad mount options.\n");
527 goto bail0; 531 goto bail0;
528 } 532 }
529 if (o==2) { 533 if (o==2) {
@@ -542,16 +546,17 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
542 if (/*le16_to_cpu(bootblock->magic) != BB_MAGIC 546 if (/*le16_to_cpu(bootblock->magic) != BB_MAGIC
543 ||*/ le32_to_cpu(superblock->magic) != SB_MAGIC 547 ||*/ le32_to_cpu(superblock->magic) != SB_MAGIC
544 || le32_to_cpu(spareblock->magic) != SP_MAGIC) { 548 || le32_to_cpu(spareblock->magic) != SP_MAGIC) {
545 if (!silent) printk("HPFS: Bad magic ... probably not HPFS\n"); 549 if (!silent)
550 pr_warn("HPFS: Bad magic ... probably not HPFS\n");
546 goto bail4; 551 goto bail4;
547 } 552 }
548 553
549 /* Check version */ 554 /* Check version */
550 if (!(s->s_flags & MS_RDONLY) && 555 if (!(s->s_flags & MS_RDONLY) &&
551 superblock->funcversion != 2 && superblock->funcversion != 3) { 556 superblock->funcversion != 2 && superblock->funcversion != 3) {
552 printk("HPFS: Bad version %d,%d. Mount readonly to go around\n", 557 pr_warn("HPFS: Bad version %d,%d. Mount readonly to go around\n",
553 (int)superblock->version, (int)superblock->funcversion); 558 (int)superblock->version, (int)superblock->funcversion);
554 printk("HPFS: please try recent version of HPFS driver at http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi and if it still can't understand this format, contact author - mikulas@artax.karlin.mff.cuni.cz\n"); 559 pr_warn("HPFS: please try recent version of HPFS driver at http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi and if it still can't understand this format, contact author - mikulas@artax.karlin.mff.cuni.cz\n");
555 goto bail4; 560 goto bail4;
556 } 561 }
557 562
@@ -597,7 +602,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
597 /* Check for general fs errors*/ 602 /* Check for general fs errors*/
598 if (spareblock->dirty && !spareblock->old_wrote) { 603 if (spareblock->dirty && !spareblock->old_wrote) {
599 if (errs == 2) { 604 if (errs == 2) {
600 printk("HPFS: Improperly stopped, not mounted\n"); 605 pr_warn("HPFS: Improperly stopped, not mounted\n");
601 goto bail4; 606 goto bail4;
602 } 607 }
603 hpfs_error(s, "improperly stopped"); 608 hpfs_error(s, "improperly stopped");
@@ -611,22 +616,25 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
611 616
612 if (spareblock->hotfixes_used || spareblock->n_spares_used) { 617 if (spareblock->hotfixes_used || spareblock->n_spares_used) {
613 if (errs >= 2) { 618 if (errs >= 2) {
614 printk("HPFS: Hotfixes not supported here, try chkdsk\n"); 619 pr_warn("HPFS: Hotfixes not supported here, try chkdsk\n");
615 mark_dirty(s, 0); 620 mark_dirty(s, 0);
616 goto bail4; 621 goto bail4;
617 } 622 }
618 hpfs_error(s, "hotfixes not supported here, try chkdsk"); 623 hpfs_error(s, "hotfixes not supported here, try chkdsk");
619 if (errs == 0) printk("HPFS: Proceeding, but your filesystem will be probably corrupted by this driver...\n"); 624 if (errs == 0)
620 else printk("HPFS: This driver may read bad files or crash when operating on disk with hotfixes.\n"); 625 pr_warn("HPFS: Proceeding, but your filesystem will be probably corrupted by this driver...\n");
626 else
627 pr_warn("HPFS: This driver may read bad files or crash when operating on disk with hotfixes.\n");
621 } 628 }
622 if (le32_to_cpu(spareblock->n_dnode_spares) != le32_to_cpu(spareblock->n_dnode_spares_free)) { 629 if (le32_to_cpu(spareblock->n_dnode_spares) != le32_to_cpu(spareblock->n_dnode_spares_free)) {
623 if (errs >= 2) { 630 if (errs >= 2) {
624 printk("HPFS: Spare dnodes used, try chkdsk\n"); 631 pr_warn("HPFS: Spare dnodes used, try chkdsk\n");
625 mark_dirty(s, 0); 632 mark_dirty(s, 0);
626 goto bail4; 633 goto bail4;
627 } 634 }
628 hpfs_error(s, "warning: spare dnodes used, try chkdsk"); 635 hpfs_error(s, "warning: spare dnodes used, try chkdsk");
629 if (errs == 0) printk("HPFS: Proceeding, but your filesystem could be corrupted if you delete files or directories\n"); 636 if (errs == 0)
637 pr_warn("HPFS: Proceeding, but your filesystem could be corrupted if you delete files or directories\n");
630 } 638 }
631 if (chk) { 639 if (chk) {
632 unsigned a; 640 unsigned a;
@@ -645,12 +653,13 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
645 goto bail4; 653 goto bail4;
646 } 654 }
647 sbi->sb_dirband_size = a; 655 sbi->sb_dirband_size = a;
648 } else printk("HPFS: You really don't want any checks? You are crazy...\n"); 656 } else
657 pr_warn("HPFS: You really don't want any checks? You are crazy...\n");
649 658
650 /* Load code page table */ 659 /* Load code page table */
651 if (le32_to_cpu(spareblock->n_code_pages)) 660 if (le32_to_cpu(spareblock->n_code_pages))
652 if (!(sbi->sb_cp_table = hpfs_load_code_page(s, le32_to_cpu(spareblock->code_page_dir)))) 661 if (!(sbi->sb_cp_table = hpfs_load_code_page(s, le32_to_cpu(spareblock->code_page_dir))))
653 printk("HPFS: Warning: code page support is disabled\n"); 662 pr_warn("HPFS: Warning: code page support is disabled\n");
654 663
655 brelse(bh2); 664 brelse(bh2);
656 brelse(bh1); 665 brelse(bh1);