Commit 2314b07cb47ef7d7da5779977f8c3bf1b65748d2
Committed by
Jan Kara
1 parent
dee1d3b627
Exists in
master
and in
39 other branches
ext2: Unify log messages in ext2
make messages produced by ext2 more unified. It should be easy to parse. dmesg before patch: [ 4893.684892] reservations ON [ 4893.684896] xip option not supported [ 4893.684961] EXT2-fs warning: mounting ext3 filesystem as ext2 [ 4893.684964] EXT2-fs warning: maximal mount count reached, running e2fsck is recommended [ 4893.684990] EXT II FS: 0.5b, 95/08/09, bs=1024, fs=1024, gc=2, bpg=8192, ipg=1280, mo=80010] dmesg after patch: [ 4893.684892] EXT2-fs (loop0): reservations ON [ 4893.684896] EXT2-fs (loop0): xip option not supported [ 4893.684961] EXT2-fs (loop0): warning: mounting ext3 filesystem as ext2 [ 4893.684964] EXT2-fs (loop0): warning: maximal mount count reached, running e2fsck is recommended [ 4893.684990] EXT2-fs (loop0): 0.5b, 95/08/09, bs=1024, fs=1024, gc=2, bpg=8192, ipg=1280, mo=80010] Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net> Reviewed-by: Andreas Dilger <adilger@sun.com> Signed-off-by: Jan Kara <jack@suse.cz>
Showing 4 changed files with 101 additions and 80 deletions Side-by-side Diff
fs/ext2/ext2.h
... | ... | @@ -142,7 +142,7 @@ |
142 | 142 | /* super.c */ |
143 | 143 | extern void ext2_error (struct super_block *, const char *, const char *, ...) |
144 | 144 | __attribute__ ((format (printf, 3, 4))); |
145 | -extern void ext2_warning (struct super_block *, const char *, const char *, ...) | |
145 | +extern void ext2_msg(struct super_block *, const char *, const char *, ...) | |
146 | 146 | __attribute__ ((format (printf, 3, 4))); |
147 | 147 | extern void ext2_update_dynamic_rev (struct super_block *sb); |
148 | 148 | extern void ext2_write_super (struct super_block *); |
fs/ext2/inode.c
... | ... | @@ -137,7 +137,8 @@ |
137 | 137 | int final = 0; |
138 | 138 | |
139 | 139 | if (i_block < 0) { |
140 | - ext2_warning (inode->i_sb, "ext2_block_to_path", "block < 0"); | |
140 | + ext2_msg(inode->i_sb, KERN_WARNING, | |
141 | + "warning: %s: block < 0", __func__); | |
141 | 142 | } else if (i_block < direct_blocks) { |
142 | 143 | offsets[n++] = i_block; |
143 | 144 | final = direct_blocks; |
... | ... | @@ -157,7 +158,8 @@ |
157 | 158 | offsets[n++] = i_block & (ptrs - 1); |
158 | 159 | final = ptrs; |
159 | 160 | } else { |
160 | - ext2_warning (inode->i_sb, "ext2_block_to_path", "block > big"); | |
161 | + ext2_msg(inode->i_sb, KERN_WARNING, | |
162 | + "warning: %s: block is too big", __func__); | |
161 | 163 | } |
162 | 164 | if (boundary) |
163 | 165 | *boundary = final - 1 - (i_block & (ptrs - 1)); |
fs/ext2/super.c
... | ... | @@ -58,27 +58,27 @@ |
58 | 58 | } |
59 | 59 | |
60 | 60 | va_start(args, fmt); |
61 | - printk(KERN_CRIT "EXT2-fs error (device %s): %s: ",sb->s_id, function); | |
61 | + printk(KERN_CRIT "EXT2-fs (%s): error: %s: ", sb->s_id, function); | |
62 | 62 | vprintk(fmt, args); |
63 | 63 | printk("\n"); |
64 | 64 | va_end(args); |
65 | 65 | |
66 | 66 | if (test_opt(sb, ERRORS_PANIC)) |
67 | - panic("EXT2-fs panic from previous error\n"); | |
67 | + panic("EXT2-fs: panic from previous error\n"); | |
68 | 68 | if (test_opt(sb, ERRORS_RO)) { |
69 | - printk("Remounting filesystem read-only\n"); | |
69 | + ext2_msg(sb, KERN_CRIT, | |
70 | + "error: remounting filesystem read-only"); | |
70 | 71 | sb->s_flags |= MS_RDONLY; |
71 | 72 | } |
72 | 73 | } |
73 | 74 | |
74 | -void ext2_warning (struct super_block * sb, const char * function, | |
75 | - const char * fmt, ...) | |
75 | +void ext2_msg(struct super_block *sb, const char *prefix, | |
76 | + const char *fmt, ...) | |
76 | 77 | { |
77 | 78 | va_list args; |
78 | 79 | |
79 | 80 | va_start(args, fmt); |
80 | - printk(KERN_WARNING "EXT2-fs warning (device %s): %s: ", | |
81 | - sb->s_id, function); | |
81 | + printk("%sEXT2-fs (%s): ", prefix, sb->s_id); | |
82 | 82 | vprintk(fmt, args); |
83 | 83 | printk("\n"); |
84 | 84 | va_end(args); |
... | ... | @@ -91,9 +91,9 @@ |
91 | 91 | if (le32_to_cpu(es->s_rev_level) > EXT2_GOOD_OLD_REV) |
92 | 92 | return; |
93 | 93 | |
94 | - ext2_warning(sb, __func__, | |
95 | - "updating to rev %d because of new feature flag, " | |
96 | - "running e2fsck is recommended", | |
94 | + ext2_msg(sb, KERN_WARNING, | |
95 | + "warning: updating to rev %d because of " | |
96 | + "new feature flag, running e2fsck is recommended", | |
97 | 97 | EXT2_DYNAMIC_REV); |
98 | 98 | |
99 | 99 | es->s_first_ino = cpu_to_le32(EXT2_GOOD_OLD_FIRST_INO); |
100 | 100 | |
... | ... | @@ -419,10 +419,10 @@ |
419 | 419 | {Opt_err, NULL} |
420 | 420 | }; |
421 | 421 | |
422 | -static int parse_options (char * options, | |
423 | - struct ext2_sb_info *sbi) | |
422 | +static int parse_options(char *options, struct super_block *sb) | |
424 | 423 | { |
425 | - char * p; | |
424 | + char *p; | |
425 | + struct ext2_sb_info *sbi = EXT2_SB(sb); | |
426 | 426 | substring_t args[MAX_OPT_ARGS]; |
427 | 427 | int option; |
428 | 428 | |
... | ... | @@ -505,7 +505,8 @@ |
505 | 505 | #else |
506 | 506 | case Opt_user_xattr: |
507 | 507 | case Opt_nouser_xattr: |
508 | - printk("EXT2 (no)user_xattr options not supported\n"); | |
508 | + ext2_msg(sb, KERN_INFO, "(no)user_xattr options" | |
509 | + "not supported"); | |
509 | 510 | break; |
510 | 511 | #endif |
511 | 512 | #ifdef CONFIG_EXT2_FS_POSIX_ACL |
512 | 513 | |
... | ... | @@ -518,14 +519,15 @@ |
518 | 519 | #else |
519 | 520 | case Opt_acl: |
520 | 521 | case Opt_noacl: |
521 | - printk("EXT2 (no)acl options not supported\n"); | |
522 | + ext2_msg(sb, KERN_INFO, | |
523 | + "(no)acl options not supported"); | |
522 | 524 | break; |
523 | 525 | #endif |
524 | 526 | case Opt_xip: |
525 | 527 | #ifdef CONFIG_EXT2_FS_XIP |
526 | 528 | set_opt (sbi->s_mount_opt, XIP); |
527 | 529 | #else |
528 | - printk("EXT2 xip option not supported\n"); | |
530 | + ext2_msg(sb, KERN_INFO, "xip option not supported"); | |
529 | 531 | #endif |
530 | 532 | break; |
531 | 533 | |
532 | 534 | |
533 | 535 | |
... | ... | @@ -542,19 +544,18 @@ |
542 | 544 | case Opt_quota: |
543 | 545 | case Opt_usrquota: |
544 | 546 | case Opt_grpquota: |
545 | - printk(KERN_ERR | |
546 | - "EXT2-fs: quota operations not supported.\n"); | |
547 | - | |
547 | + ext2_msg(sb, KERN_INFO, | |
548 | + "quota operations not supported"); | |
548 | 549 | break; |
549 | 550 | #endif |
550 | 551 | |
551 | 552 | case Opt_reservation: |
552 | 553 | set_opt(sbi->s_mount_opt, RESERVATION); |
553 | - printk("reservations ON\n"); | |
554 | + ext2_msg(sb, KERN_INFO, "reservations ON"); | |
554 | 555 | break; |
555 | 556 | case Opt_noreservation: |
556 | 557 | clear_opt(sbi->s_mount_opt, RESERVATION); |
557 | - printk("reservations OFF\n"); | |
558 | + ext2_msg(sb, KERN_INFO, "reservations OFF"); | |
558 | 559 | break; |
559 | 560 | case Opt_ignore: |
560 | 561 | break; |
561 | 562 | |
562 | 563 | |
563 | 564 | |
564 | 565 | |
565 | 566 | |
... | ... | @@ -573,34 +574,40 @@ |
573 | 574 | struct ext2_sb_info *sbi = EXT2_SB(sb); |
574 | 575 | |
575 | 576 | if (le32_to_cpu(es->s_rev_level) > EXT2_MAX_SUPP_REV) { |
576 | - printk ("EXT2-fs warning: revision level too high, " | |
577 | - "forcing read-only mode\n"); | |
577 | + ext2_msg(sb, KERN_ERR, | |
578 | + "error: revision level too high, " | |
579 | + "forcing read-only mode"); | |
578 | 580 | res = MS_RDONLY; |
579 | 581 | } |
580 | 582 | if (read_only) |
581 | 583 | return res; |
582 | 584 | if (!(sbi->s_mount_state & EXT2_VALID_FS)) |
583 | - printk ("EXT2-fs warning: mounting unchecked fs, " | |
584 | - "running e2fsck is recommended\n"); | |
585 | + ext2_msg(sb, KERN_WARNING, | |
586 | + "warning: mounting unchecked fs, " | |
587 | + "running e2fsck is recommended"); | |
585 | 588 | else if ((sbi->s_mount_state & EXT2_ERROR_FS)) |
586 | - printk ("EXT2-fs warning: mounting fs with errors, " | |
587 | - "running e2fsck is recommended\n"); | |
589 | + ext2_msg(sb, KERN_WARNING, | |
590 | + "warning: mounting fs with errors, " | |
591 | + "running e2fsck is recommended"); | |
588 | 592 | else if ((__s16) le16_to_cpu(es->s_max_mnt_count) >= 0 && |
589 | 593 | le16_to_cpu(es->s_mnt_count) >= |
590 | 594 | (unsigned short) (__s16) le16_to_cpu(es->s_max_mnt_count)) |
591 | - printk ("EXT2-fs warning: maximal mount count reached, " | |
592 | - "running e2fsck is recommended\n"); | |
595 | + ext2_msg(sb, KERN_WARNING, | |
596 | + "warning: maximal mount count reached, " | |
597 | + "running e2fsck is recommended"); | |
593 | 598 | else if (le32_to_cpu(es->s_checkinterval) && |
594 | - (le32_to_cpu(es->s_lastcheck) + le32_to_cpu(es->s_checkinterval) <= get_seconds())) | |
595 | - printk ("EXT2-fs warning: checktime reached, " | |
596 | - "running e2fsck is recommended\n"); | |
599 | + (le32_to_cpu(es->s_lastcheck) + | |
600 | + le32_to_cpu(es->s_checkinterval) <= get_seconds())) | |
601 | + ext2_msg(sb, KERN_WARNING, | |
602 | + "warning: checktime reached, " | |
603 | + "running e2fsck is recommended"); | |
597 | 604 | if (!le16_to_cpu(es->s_max_mnt_count)) |
598 | 605 | es->s_max_mnt_count = cpu_to_le16(EXT2_DFL_MAX_MNT_COUNT); |
599 | 606 | le16_add_cpu(&es->s_mnt_count, 1); |
600 | 607 | ext2_write_super(sb); |
601 | 608 | if (test_opt (sb, DEBUG)) |
602 | - printk ("[EXT II FS %s, %s, bs=%lu, fs=%lu, gc=%lu, " | |
603 | - "bpg=%lu, ipg=%lu, mo=%04lx]\n", | |
609 | + ext2_msg(sb, KERN_INFO, "%s, %s, bs=%lu, fs=%lu, gc=%lu, " | |
610 | + "bpg=%lu, ipg=%lu, mo=%04lx]", | |
604 | 611 | EXT2FS_VERSION, EXT2FS_DATE, sb->s_blocksize, |
605 | 612 | sbi->s_frag_size, |
606 | 613 | sbi->s_groups_count, |
... | ... | @@ -767,7 +774,7 @@ |
767 | 774 | */ |
768 | 775 | blocksize = sb_min_blocksize(sb, BLOCK_SIZE); |
769 | 776 | if (!blocksize) { |
770 | - printk ("EXT2-fs: unable to set blocksize\n"); | |
777 | + ext2_msg(sb, KERN_ERR, "error: unable to set blocksize"); | |
771 | 778 | goto failed_sbi; |
772 | 779 | } |
773 | 780 | |
... | ... | @@ -783,7 +790,7 @@ |
783 | 790 | } |
784 | 791 | |
785 | 792 | if (!(bh = sb_bread(sb, logic_sb_block))) { |
786 | - printk ("EXT2-fs: unable to read superblock\n"); | |
793 | + ext2_msg(sb, KERN_ERR, "error: unable to read superblock"); | |
787 | 794 | goto failed_sbi; |
788 | 795 | } |
789 | 796 | /* |
... | ... | @@ -826,7 +833,7 @@ |
826 | 833 | |
827 | 834 | set_opt(sbi->s_mount_opt, RESERVATION); |
828 | 835 | |
829 | - if (!parse_options ((char *) data, sbi)) | |
836 | + if (!parse_options((char *) data, sb)) | |
830 | 837 | goto failed_mount; |
831 | 838 | |
832 | 839 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | |
... | ... | @@ -840,8 +847,9 @@ |
840 | 847 | (EXT2_HAS_COMPAT_FEATURE(sb, ~0U) || |
841 | 848 | EXT2_HAS_RO_COMPAT_FEATURE(sb, ~0U) || |
842 | 849 | EXT2_HAS_INCOMPAT_FEATURE(sb, ~0U))) |
843 | - printk("EXT2-fs warning: feature flags set on rev 0 fs, " | |
844 | - "running e2fsck is recommended\n"); | |
850 | + ext2_msg(sb, KERN_WARNING, | |
851 | + "warning: feature flags set on rev 0 fs, " | |
852 | + "running e2fsck is recommended"); | |
845 | 853 | /* |
846 | 854 | * Check feature flags regardless of the revision level, since we |
847 | 855 | * previously didn't change the revision level when setting the flags, |
848 | 856 | |
... | ... | @@ -849,16 +857,16 @@ |
849 | 857 | */ |
850 | 858 | features = EXT2_HAS_INCOMPAT_FEATURE(sb, ~EXT2_FEATURE_INCOMPAT_SUPP); |
851 | 859 | if (features) { |
852 | - printk("EXT2-fs: %s: couldn't mount because of " | |
853 | - "unsupported optional features (%x).\n", | |
854 | - sb->s_id, le32_to_cpu(features)); | |
860 | + ext2_msg(sb, KERN_ERR, "error: couldn't mount because of " | |
861 | + "unsupported optional features (%x)", | |
862 | + le32_to_cpu(features)); | |
855 | 863 | goto failed_mount; |
856 | 864 | } |
857 | 865 | if (!(sb->s_flags & MS_RDONLY) && |
858 | 866 | (features = EXT2_HAS_RO_COMPAT_FEATURE(sb, ~EXT2_FEATURE_RO_COMPAT_SUPP))){ |
859 | - printk("EXT2-fs: %s: couldn't mount RDWR because of " | |
860 | - "unsupported optional features (%x).\n", | |
861 | - sb->s_id, le32_to_cpu(features)); | |
867 | + ext2_msg(sb, KERN_ERR, "error: couldn't mount RDWR because of " | |
868 | + "unsupported optional features (%x)", | |
869 | + le32_to_cpu(features)); | |
862 | 870 | goto failed_mount; |
863 | 871 | } |
864 | 872 | |
... | ... | @@ -866,7 +874,8 @@ |
866 | 874 | |
867 | 875 | if (ext2_use_xip(sb) && blocksize != PAGE_SIZE) { |
868 | 876 | if (!silent) |
869 | - printk("XIP: Unsupported blocksize\n"); | |
877 | + ext2_msg(sb, KERN_ERR, | |
878 | + "error: unsupported blocksize for xip"); | |
870 | 879 | goto failed_mount; |
871 | 880 | } |
872 | 881 | |
... | ... | @@ -875,7 +884,7 @@ |
875 | 884 | brelse(bh); |
876 | 885 | |
877 | 886 | if (!sb_set_blocksize(sb, blocksize)) { |
878 | - printk(KERN_ERR "EXT2-fs: blocksize too small for device.\n"); | |
887 | + ext2_msg(sb, KERN_ERR, "error: blocksize is too small"); | |
879 | 888 | goto failed_sbi; |
880 | 889 | } |
881 | 890 | |
882 | 891 | |
... | ... | @@ -883,14 +892,14 @@ |
883 | 892 | offset = (sb_block*BLOCK_SIZE) % blocksize; |
884 | 893 | bh = sb_bread(sb, logic_sb_block); |
885 | 894 | if(!bh) { |
886 | - printk("EXT2-fs: Couldn't read superblock on " | |
887 | - "2nd try.\n"); | |
895 | + ext2_msg(sb, KERN_ERR, "error: couldn't read" | |
896 | + "superblock on 2nd try"); | |
888 | 897 | goto failed_sbi; |
889 | 898 | } |
890 | 899 | es = (struct ext2_super_block *) (((char *)bh->b_data) + offset); |
891 | 900 | sbi->s_es = es; |
892 | 901 | if (es->s_magic != cpu_to_le16(EXT2_SUPER_MAGIC)) { |
893 | - printk ("EXT2-fs: Magic mismatch, very weird !\n"); | |
902 | + ext2_msg(sb, KERN_ERR, "error: magic mismatch"); | |
894 | 903 | goto failed_mount; |
895 | 904 | } |
896 | 905 | } |
... | ... | @@ -906,7 +915,8 @@ |
906 | 915 | if ((sbi->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE) || |
907 | 916 | !is_power_of_2(sbi->s_inode_size) || |
908 | 917 | (sbi->s_inode_size > blocksize)) { |
909 | - printk ("EXT2-fs: unsupported inode size: %d\n", | |
918 | + ext2_msg(sb, KERN_ERR, | |
919 | + "error: unsupported inode size: %d", | |
910 | 920 | sbi->s_inode_size); |
911 | 921 | goto failed_mount; |
912 | 922 | } |
913 | 923 | |
914 | 924 | |
915 | 925 | |
916 | 926 | |
... | ... | @@ -943,29 +953,33 @@ |
943 | 953 | |
944 | 954 | if (sb->s_blocksize != bh->b_size) { |
945 | 955 | if (!silent) |
946 | - printk ("VFS: Unsupported blocksize on dev " | |
947 | - "%s.\n", sb->s_id); | |
956 | + ext2_msg(sb, KERN_ERR, "error: unsupported blocksize"); | |
948 | 957 | goto failed_mount; |
949 | 958 | } |
950 | 959 | |
951 | 960 | if (sb->s_blocksize != sbi->s_frag_size) { |
952 | - printk ("EXT2-fs: fragsize %lu != blocksize %lu (not supported yet)\n", | |
961 | + ext2_msg(sb, KERN_ERR, | |
962 | + "error: fragsize %lu != blocksize %lu" | |
963 | + "(not supported yet)", | |
953 | 964 | sbi->s_frag_size, sb->s_blocksize); |
954 | 965 | goto failed_mount; |
955 | 966 | } |
956 | 967 | |
957 | 968 | if (sbi->s_blocks_per_group > sb->s_blocksize * 8) { |
958 | - printk ("EXT2-fs: #blocks per group too big: %lu\n", | |
969 | + ext2_msg(sb, KERN_ERR, | |
970 | + "error: #blocks per group too big: %lu", | |
959 | 971 | sbi->s_blocks_per_group); |
960 | 972 | goto failed_mount; |
961 | 973 | } |
962 | 974 | if (sbi->s_frags_per_group > sb->s_blocksize * 8) { |
963 | - printk ("EXT2-fs: #fragments per group too big: %lu\n", | |
975 | + ext2_msg(sb, KERN_ERR, | |
976 | + "error: #fragments per group too big: %lu", | |
964 | 977 | sbi->s_frags_per_group); |
965 | 978 | goto failed_mount; |
966 | 979 | } |
967 | 980 | if (sbi->s_inodes_per_group > sb->s_blocksize * 8) { |
968 | - printk ("EXT2-fs: #inodes per group too big: %lu\n", | |
981 | + ext2_msg(sb, KERN_ERR, | |
982 | + "error: #inodes per group too big: %lu", | |
969 | 983 | sbi->s_inodes_per_group); |
970 | 984 | goto failed_mount; |
971 | 985 | } |
972 | 986 | |
... | ... | @@ -979,13 +993,13 @@ |
979 | 993 | EXT2_DESC_PER_BLOCK(sb); |
980 | 994 | sbi->s_group_desc = kmalloc (db_count * sizeof (struct buffer_head *), GFP_KERNEL); |
981 | 995 | if (sbi->s_group_desc == NULL) { |
982 | - printk ("EXT2-fs: not enough memory\n"); | |
996 | + ext2_msg(sb, KERN_ERR, "error: not enough memory"); | |
983 | 997 | goto failed_mount; |
984 | 998 | } |
985 | 999 | bgl_lock_init(sbi->s_blockgroup_lock); |
986 | 1000 | sbi->s_debts = kcalloc(sbi->s_groups_count, sizeof(*sbi->s_debts), GFP_KERNEL); |
987 | 1001 | if (!sbi->s_debts) { |
988 | - printk ("EXT2-fs: not enough memory\n"); | |
1002 | + ext2_msg(sb, KERN_ERR, "error: not enough memory"); | |
989 | 1003 | goto failed_mount_group_desc; |
990 | 1004 | } |
991 | 1005 | for (i = 0; i < db_count; i++) { |
992 | 1006 | |
... | ... | @@ -994,12 +1008,13 @@ |
994 | 1008 | if (!sbi->s_group_desc[i]) { |
995 | 1009 | for (j = 0; j < i; j++) |
996 | 1010 | brelse (sbi->s_group_desc[j]); |
997 | - printk ("EXT2-fs: unable to read group descriptors\n"); | |
1011 | + ext2_msg(sb, KERN_ERR, | |
1012 | + "error: unable to read group descriptors"); | |
998 | 1013 | goto failed_mount_group_desc; |
999 | 1014 | } |
1000 | 1015 | } |
1001 | 1016 | if (!ext2_check_descriptors (sb)) { |
1002 | - printk ("EXT2-fs: group descriptors corrupted!\n"); | |
1017 | + ext2_msg(sb, KERN_ERR, "group descriptors corrupted"); | |
1003 | 1018 | goto failed_mount2; |
1004 | 1019 | } |
1005 | 1020 | sbi->s_gdb_count = db_count; |
... | ... | @@ -1032,7 +1047,7 @@ |
1032 | 1047 | ext2_count_dirs(sb)); |
1033 | 1048 | } |
1034 | 1049 | if (err) { |
1035 | - printk(KERN_ERR "EXT2-fs: insufficient memory\n"); | |
1050 | + ext2_msg(sb, KERN_ERR, "error: insufficient memory"); | |
1036 | 1051 | goto failed_mount3; |
1037 | 1052 | } |
1038 | 1053 | /* |
1039 | 1054 | |
1040 | 1055 | |
1041 | 1056 | |
... | ... | @@ -1048,27 +1063,28 @@ |
1048 | 1063 | } |
1049 | 1064 | if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) { |
1050 | 1065 | iput(root); |
1051 | - printk(KERN_ERR "EXT2-fs: corrupt root inode, run e2fsck\n"); | |
1066 | + ext2_msg(sb, KERN_ERR, "error: corrupt root inode, run e2fsck"); | |
1052 | 1067 | goto failed_mount3; |
1053 | 1068 | } |
1054 | 1069 | |
1055 | 1070 | sb->s_root = d_alloc_root(root); |
1056 | 1071 | if (!sb->s_root) { |
1057 | 1072 | iput(root); |
1058 | - printk(KERN_ERR "EXT2-fs: get root inode failed\n"); | |
1073 | + ext2_msg(sb, KERN_ERR, "error: get root inode failed"); | |
1059 | 1074 | ret = -ENOMEM; |
1060 | 1075 | goto failed_mount3; |
1061 | 1076 | } |
1062 | 1077 | if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) |
1063 | - ext2_warning(sb, __func__, | |
1064 | - "mounting ext3 filesystem as ext2"); | |
1078 | + ext2_msg(sb, KERN_WARNING, | |
1079 | + "warning: mounting ext3 filesystem as ext2"); | |
1065 | 1080 | ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY); |
1066 | 1081 | return 0; |
1067 | 1082 | |
1068 | 1083 | cantfind_ext2: |
1069 | 1084 | if (!silent) |
1070 | - printk("VFS: Can't find an ext2 filesystem on dev %s.\n", | |
1071 | - sb->s_id); | |
1085 | + ext2_msg(sb, KERN_ERR, | |
1086 | + "error: can't find an ext2 filesystem on dev %s.", | |
1087 | + sb->s_id); | |
1072 | 1088 | goto failed_mount; |
1073 | 1089 | failed_mount3: |
1074 | 1090 | percpu_counter_destroy(&sbi->s_freeblocks_counter); |
... | ... | @@ -1170,7 +1186,7 @@ |
1170 | 1186 | /* |
1171 | 1187 | * Allow the "check" option to be passed as a remount option. |
1172 | 1188 | */ |
1173 | - if (!parse_options (data, sbi)) { | |
1189 | + if (!parse_options(data, sb)) { | |
1174 | 1190 | err = -EINVAL; |
1175 | 1191 | goto restore_opts; |
1176 | 1192 | } |
... | ... | @@ -1182,7 +1198,8 @@ |
1182 | 1198 | EXT2_MOUNT_XIP if not */ |
1183 | 1199 | |
1184 | 1200 | if ((ext2_use_xip(sb)) && (sb->s_blocksize != PAGE_SIZE)) { |
1185 | - printk("XIP: Unsupported blocksize\n"); | |
1201 | + ext2_msg(sb, KERN_WARNING, | |
1202 | + "warning: unsupported blocksize for xip"); | |
1186 | 1203 | err = -EINVAL; |
1187 | 1204 | goto restore_opts; |
1188 | 1205 | } |
... | ... | @@ -1191,8 +1208,8 @@ |
1191 | 1208 | if (((sbi->s_mount_opt & EXT2_MOUNT_XIP) != |
1192 | 1209 | (old_mount_opt & EXT2_MOUNT_XIP)) && |
1193 | 1210 | invalidate_inodes(sb)) { |
1194 | - ext2_warning(sb, __func__, "refusing change of xip flag " | |
1195 | - "with busy inodes while remounting"); | |
1211 | + ext2_msg(sb, KERN_WARNING, "warning: refusing change of " | |
1212 | + "xip flag with busy inodes while remounting"); | |
1196 | 1213 | sbi->s_mount_opt &= ~EXT2_MOUNT_XIP; |
1197 | 1214 | sbi->s_mount_opt |= old_mount_opt & EXT2_MOUNT_XIP; |
1198 | 1215 | } |
... | ... | @@ -1216,9 +1233,10 @@ |
1216 | 1233 | __le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb, |
1217 | 1234 | ~EXT2_FEATURE_RO_COMPAT_SUPP); |
1218 | 1235 | if (ret) { |
1219 | - printk("EXT2-fs: %s: couldn't remount RDWR because of " | |
1220 | - "unsupported optional features (%x).\n", | |
1221 | - sb->s_id, le32_to_cpu(ret)); | |
1236 | + ext2_msg(sb, KERN_WARNING, | |
1237 | + "warning: couldn't remount RDWR because of " | |
1238 | + "unsupported optional features (%x).", | |
1239 | + le32_to_cpu(ret)); | |
1222 | 1240 | err = -EROFS; |
1223 | 1241 | goto restore_opts; |
1224 | 1242 | } |
fs/ext2/xip.c
... | ... | @@ -69,8 +69,9 @@ |
69 | 69 | if ((sbi->s_mount_opt & EXT2_MOUNT_XIP) && |
70 | 70 | !sb->s_bdev->bd_disk->fops->direct_access) { |
71 | 71 | sbi->s_mount_opt &= (~EXT2_MOUNT_XIP); |
72 | - ext2_warning(sb, __func__, | |
73 | - "ignoring xip option - not supported by bdev"); | |
72 | + ext2_msg(sb, KERN_WARNING, | |
73 | + "warning: ignoring xip option - " | |
74 | + "not supported by bdev"); | |
74 | 75 | } |
75 | 76 | } |
76 | 77 |