mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
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>
This commit is contained in:
parent
dee1d3b627
commit
2314b07cb4
4 changed files with 101 additions and 80 deletions
|
@ -142,7 +142,7 @@ struct dentry *ext2_get_parent(struct dentry *child);
|
||||||
/* super.c */
|
/* super.c */
|
||||||
extern void ext2_error (struct super_block *, const char *, const char *, ...)
|
extern void ext2_error (struct super_block *, const char *, const char *, ...)
|
||||||
__attribute__ ((format (printf, 3, 4)));
|
__attribute__ ((format (printf, 3, 4)));
|
||||||
extern void ext2_warning (struct super_block *, const char *, const char *, ...)
|
extern void ext2_msg(struct super_block *, const char *, const char *, ...)
|
||||||
__attribute__ ((format (printf, 3, 4)));
|
__attribute__ ((format (printf, 3, 4)));
|
||||||
extern void ext2_update_dynamic_rev (struct super_block *sb);
|
extern void ext2_update_dynamic_rev (struct super_block *sb);
|
||||||
extern void ext2_write_super (struct super_block *);
|
extern void ext2_write_super (struct super_block *);
|
||||||
|
|
|
@ -137,7 +137,8 @@ static int ext2_block_to_path(struct inode *inode,
|
||||||
int final = 0;
|
int final = 0;
|
||||||
|
|
||||||
if (i_block < 0) {
|
if (i_block < 0) {
|
||||||
ext2_warning (inode->i_sb, "ext2_block_to_path", "block < 0");
|
ext2_msg(inode->i_sb, KERN_WARNING,
|
||||||
|
"warning: %s: block < 0", __func__);
|
||||||
} else if (i_block < direct_blocks) {
|
} else if (i_block < direct_blocks) {
|
||||||
offsets[n++] = i_block;
|
offsets[n++] = i_block;
|
||||||
final = direct_blocks;
|
final = direct_blocks;
|
||||||
|
@ -157,7 +158,8 @@ static int ext2_block_to_path(struct inode *inode,
|
||||||
offsets[n++] = i_block & (ptrs - 1);
|
offsets[n++] = i_block & (ptrs - 1);
|
||||||
final = ptrs;
|
final = ptrs;
|
||||||
} else {
|
} else {
|
||||||
ext2_warning (inode->i_sb, "ext2_block_to_path", "block > big");
|
ext2_msg(inode->i_sb, KERN_WARNING,
|
||||||
|
"warning: %s: block is too big", __func__);
|
||||||
}
|
}
|
||||||
if (boundary)
|
if (boundary)
|
||||||
*boundary = final - 1 - (i_block & (ptrs - 1));
|
*boundary = final - 1 - (i_block & (ptrs - 1));
|
||||||
|
|
168
fs/ext2/super.c
168
fs/ext2/super.c
|
@ -58,27 +58,27 @@ void ext2_error (struct super_block * sb, const char * function,
|
||||||
}
|
}
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
printk(KERN_CRIT "EXT2-fs error (device %s): %s: ",sb->s_id, function);
|
printk(KERN_CRIT "EXT2-fs (%s): error: %s: ", sb->s_id, function);
|
||||||
vprintk(fmt, args);
|
vprintk(fmt, args);
|
||||||
printk("\n");
|
printk("\n");
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
if (test_opt(sb, ERRORS_PANIC))
|
if (test_opt(sb, ERRORS_PANIC))
|
||||||
panic("EXT2-fs panic from previous error\n");
|
panic("EXT2-fs: panic from previous error\n");
|
||||||
if (test_opt(sb, ERRORS_RO)) {
|
if (test_opt(sb, ERRORS_RO)) {
|
||||||
printk("Remounting filesystem read-only\n");
|
ext2_msg(sb, KERN_CRIT,
|
||||||
|
"error: remounting filesystem read-only");
|
||||||
sb->s_flags |= MS_RDONLY;
|
sb->s_flags |= MS_RDONLY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ext2_warning (struct super_block * sb, const char * function,
|
void ext2_msg(struct super_block *sb, const char *prefix,
|
||||||
const char * fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
printk(KERN_WARNING "EXT2-fs warning (device %s): %s: ",
|
printk("%sEXT2-fs (%s): ", prefix, sb->s_id);
|
||||||
sb->s_id, function);
|
|
||||||
vprintk(fmt, args);
|
vprintk(fmt, args);
|
||||||
printk("\n");
|
printk("\n");
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
@ -91,9 +91,9 @@ void ext2_update_dynamic_rev(struct super_block *sb)
|
||||||
if (le32_to_cpu(es->s_rev_level) > EXT2_GOOD_OLD_REV)
|
if (le32_to_cpu(es->s_rev_level) > EXT2_GOOD_OLD_REV)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ext2_warning(sb, __func__,
|
ext2_msg(sb, KERN_WARNING,
|
||||||
"updating to rev %d because of new feature flag, "
|
"warning: updating to rev %d because of "
|
||||||
"running e2fsck is recommended",
|
"new feature flag, running e2fsck is recommended",
|
||||||
EXT2_DYNAMIC_REV);
|
EXT2_DYNAMIC_REV);
|
||||||
|
|
||||||
es->s_first_ino = cpu_to_le32(EXT2_GOOD_OLD_FIRST_INO);
|
es->s_first_ino = cpu_to_le32(EXT2_GOOD_OLD_FIRST_INO);
|
||||||
|
@ -419,10 +419,10 @@ static const match_table_t tokens = {
|
||||||
{Opt_err, NULL}
|
{Opt_err, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
static int parse_options (char * options,
|
static int parse_options(char *options, struct super_block *sb)
|
||||||
struct ext2_sb_info *sbi)
|
|
||||||
{
|
{
|
||||||
char * p;
|
char *p;
|
||||||
|
struct ext2_sb_info *sbi = EXT2_SB(sb);
|
||||||
substring_t args[MAX_OPT_ARGS];
|
substring_t args[MAX_OPT_ARGS];
|
||||||
int option;
|
int option;
|
||||||
|
|
||||||
|
@ -505,7 +505,8 @@ static int parse_options (char * options,
|
||||||
#else
|
#else
|
||||||
case Opt_user_xattr:
|
case Opt_user_xattr:
|
||||||
case Opt_nouser_xattr:
|
case Opt_nouser_xattr:
|
||||||
printk("EXT2 (no)user_xattr options not supported\n");
|
ext2_msg(sb, KERN_INFO, "(no)user_xattr options"
|
||||||
|
"not supported");
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_EXT2_FS_POSIX_ACL
|
#ifdef CONFIG_EXT2_FS_POSIX_ACL
|
||||||
|
@ -518,14 +519,15 @@ static int parse_options (char * options,
|
||||||
#else
|
#else
|
||||||
case Opt_acl:
|
case Opt_acl:
|
||||||
case Opt_noacl:
|
case Opt_noacl:
|
||||||
printk("EXT2 (no)acl options not supported\n");
|
ext2_msg(sb, KERN_INFO,
|
||||||
|
"(no)acl options not supported");
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case Opt_xip:
|
case Opt_xip:
|
||||||
#ifdef CONFIG_EXT2_FS_XIP
|
#ifdef CONFIG_EXT2_FS_XIP
|
||||||
set_opt (sbi->s_mount_opt, XIP);
|
set_opt (sbi->s_mount_opt, XIP);
|
||||||
#else
|
#else
|
||||||
printk("EXT2 xip option not supported\n");
|
ext2_msg(sb, KERN_INFO, "xip option not supported");
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -542,19 +544,18 @@ static int parse_options (char * options,
|
||||||
case Opt_quota:
|
case Opt_quota:
|
||||||
case Opt_usrquota:
|
case Opt_usrquota:
|
||||||
case Opt_grpquota:
|
case Opt_grpquota:
|
||||||
printk(KERN_ERR
|
ext2_msg(sb, KERN_INFO,
|
||||||
"EXT2-fs: quota operations not supported.\n");
|
"quota operations not supported");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case Opt_reservation:
|
case Opt_reservation:
|
||||||
set_opt(sbi->s_mount_opt, RESERVATION);
|
set_opt(sbi->s_mount_opt, RESERVATION);
|
||||||
printk("reservations ON\n");
|
ext2_msg(sb, KERN_INFO, "reservations ON");
|
||||||
break;
|
break;
|
||||||
case Opt_noreservation:
|
case Opt_noreservation:
|
||||||
clear_opt(sbi->s_mount_opt, RESERVATION);
|
clear_opt(sbi->s_mount_opt, RESERVATION);
|
||||||
printk("reservations OFF\n");
|
ext2_msg(sb, KERN_INFO, "reservations OFF");
|
||||||
break;
|
break;
|
||||||
case Opt_ignore:
|
case Opt_ignore:
|
||||||
break;
|
break;
|
||||||
|
@ -573,34 +574,40 @@ static int ext2_setup_super (struct super_block * sb,
|
||||||
struct ext2_sb_info *sbi = EXT2_SB(sb);
|
struct ext2_sb_info *sbi = EXT2_SB(sb);
|
||||||
|
|
||||||
if (le32_to_cpu(es->s_rev_level) > EXT2_MAX_SUPP_REV) {
|
if (le32_to_cpu(es->s_rev_level) > EXT2_MAX_SUPP_REV) {
|
||||||
printk ("EXT2-fs warning: revision level too high, "
|
ext2_msg(sb, KERN_ERR,
|
||||||
"forcing read-only mode\n");
|
"error: revision level too high, "
|
||||||
|
"forcing read-only mode");
|
||||||
res = MS_RDONLY;
|
res = MS_RDONLY;
|
||||||
}
|
}
|
||||||
if (read_only)
|
if (read_only)
|
||||||
return res;
|
return res;
|
||||||
if (!(sbi->s_mount_state & EXT2_VALID_FS))
|
if (!(sbi->s_mount_state & EXT2_VALID_FS))
|
||||||
printk ("EXT2-fs warning: mounting unchecked fs, "
|
ext2_msg(sb, KERN_WARNING,
|
||||||
"running e2fsck is recommended\n");
|
"warning: mounting unchecked fs, "
|
||||||
|
"running e2fsck is recommended");
|
||||||
else if ((sbi->s_mount_state & EXT2_ERROR_FS))
|
else if ((sbi->s_mount_state & EXT2_ERROR_FS))
|
||||||
printk ("EXT2-fs warning: mounting fs with errors, "
|
ext2_msg(sb, KERN_WARNING,
|
||||||
"running e2fsck is recommended\n");
|
"warning: mounting fs with errors, "
|
||||||
|
"running e2fsck is recommended");
|
||||||
else if ((__s16) le16_to_cpu(es->s_max_mnt_count) >= 0 &&
|
else if ((__s16) le16_to_cpu(es->s_max_mnt_count) >= 0 &&
|
||||||
le16_to_cpu(es->s_mnt_count) >=
|
le16_to_cpu(es->s_mnt_count) >=
|
||||||
(unsigned short) (__s16) le16_to_cpu(es->s_max_mnt_count))
|
(unsigned short) (__s16) le16_to_cpu(es->s_max_mnt_count))
|
||||||
printk ("EXT2-fs warning: maximal mount count reached, "
|
ext2_msg(sb, KERN_WARNING,
|
||||||
"running e2fsck is recommended\n");
|
"warning: maximal mount count reached, "
|
||||||
|
"running e2fsck is recommended");
|
||||||
else if (le32_to_cpu(es->s_checkinterval) &&
|
else if (le32_to_cpu(es->s_checkinterval) &&
|
||||||
(le32_to_cpu(es->s_lastcheck) + le32_to_cpu(es->s_checkinterval) <= get_seconds()))
|
(le32_to_cpu(es->s_lastcheck) +
|
||||||
printk ("EXT2-fs warning: checktime reached, "
|
le32_to_cpu(es->s_checkinterval) <= get_seconds()))
|
||||||
"running e2fsck is recommended\n");
|
ext2_msg(sb, KERN_WARNING,
|
||||||
|
"warning: checktime reached, "
|
||||||
|
"running e2fsck is recommended");
|
||||||
if (!le16_to_cpu(es->s_max_mnt_count))
|
if (!le16_to_cpu(es->s_max_mnt_count))
|
||||||
es->s_max_mnt_count = cpu_to_le16(EXT2_DFL_MAX_MNT_COUNT);
|
es->s_max_mnt_count = cpu_to_le16(EXT2_DFL_MAX_MNT_COUNT);
|
||||||
le16_add_cpu(&es->s_mnt_count, 1);
|
le16_add_cpu(&es->s_mnt_count, 1);
|
||||||
ext2_write_super(sb);
|
ext2_write_super(sb);
|
||||||
if (test_opt (sb, DEBUG))
|
if (test_opt (sb, DEBUG))
|
||||||
printk ("[EXT II FS %s, %s, bs=%lu, fs=%lu, gc=%lu, "
|
ext2_msg(sb, KERN_INFO, "%s, %s, bs=%lu, fs=%lu, gc=%lu, "
|
||||||
"bpg=%lu, ipg=%lu, mo=%04lx]\n",
|
"bpg=%lu, ipg=%lu, mo=%04lx]",
|
||||||
EXT2FS_VERSION, EXT2FS_DATE, sb->s_blocksize,
|
EXT2FS_VERSION, EXT2FS_DATE, sb->s_blocksize,
|
||||||
sbi->s_frag_size,
|
sbi->s_frag_size,
|
||||||
sbi->s_groups_count,
|
sbi->s_groups_count,
|
||||||
|
@ -767,7 +774,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
*/
|
*/
|
||||||
blocksize = sb_min_blocksize(sb, BLOCK_SIZE);
|
blocksize = sb_min_blocksize(sb, BLOCK_SIZE);
|
||||||
if (!blocksize) {
|
if (!blocksize) {
|
||||||
printk ("EXT2-fs: unable to set blocksize\n");
|
ext2_msg(sb, KERN_ERR, "error: unable to set blocksize");
|
||||||
goto failed_sbi;
|
goto failed_sbi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -783,7 +790,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(bh = sb_bread(sb, logic_sb_block))) {
|
if (!(bh = sb_bread(sb, logic_sb_block))) {
|
||||||
printk ("EXT2-fs: unable to read superblock\n");
|
ext2_msg(sb, KERN_ERR, "error: unable to read superblock");
|
||||||
goto failed_sbi;
|
goto failed_sbi;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -826,7 +833,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
|
|
||||||
set_opt(sbi->s_mount_opt, RESERVATION);
|
set_opt(sbi->s_mount_opt, RESERVATION);
|
||||||
|
|
||||||
if (!parse_options ((char *) data, sbi))
|
if (!parse_options((char *) data, sb))
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
|
|
||||||
sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
|
sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
|
||||||
|
@ -840,8 +847,9 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
(EXT2_HAS_COMPAT_FEATURE(sb, ~0U) ||
|
(EXT2_HAS_COMPAT_FEATURE(sb, ~0U) ||
|
||||||
EXT2_HAS_RO_COMPAT_FEATURE(sb, ~0U) ||
|
EXT2_HAS_RO_COMPAT_FEATURE(sb, ~0U) ||
|
||||||
EXT2_HAS_INCOMPAT_FEATURE(sb, ~0U)))
|
EXT2_HAS_INCOMPAT_FEATURE(sb, ~0U)))
|
||||||
printk("EXT2-fs warning: feature flags set on rev 0 fs, "
|
ext2_msg(sb, KERN_WARNING,
|
||||||
"running e2fsck is recommended\n");
|
"warning: feature flags set on rev 0 fs, "
|
||||||
|
"running e2fsck is recommended");
|
||||||
/*
|
/*
|
||||||
* Check feature flags regardless of the revision level, since we
|
* Check feature flags regardless of the revision level, since we
|
||||||
* previously didn't change the revision level when setting the flags,
|
* previously didn't change the revision level when setting the flags,
|
||||||
|
@ -849,16 +857,16 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
*/
|
*/
|
||||||
features = EXT2_HAS_INCOMPAT_FEATURE(sb, ~EXT2_FEATURE_INCOMPAT_SUPP);
|
features = EXT2_HAS_INCOMPAT_FEATURE(sb, ~EXT2_FEATURE_INCOMPAT_SUPP);
|
||||||
if (features) {
|
if (features) {
|
||||||
printk("EXT2-fs: %s: couldn't mount because of "
|
ext2_msg(sb, KERN_ERR, "error: couldn't mount because of "
|
||||||
"unsupported optional features (%x).\n",
|
"unsupported optional features (%x)",
|
||||||
sb->s_id, le32_to_cpu(features));
|
le32_to_cpu(features));
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
if (!(sb->s_flags & MS_RDONLY) &&
|
if (!(sb->s_flags & MS_RDONLY) &&
|
||||||
(features = EXT2_HAS_RO_COMPAT_FEATURE(sb, ~EXT2_FEATURE_RO_COMPAT_SUPP))){
|
(features = EXT2_HAS_RO_COMPAT_FEATURE(sb, ~EXT2_FEATURE_RO_COMPAT_SUPP))){
|
||||||
printk("EXT2-fs: %s: couldn't mount RDWR because of "
|
ext2_msg(sb, KERN_ERR, "error: couldn't mount RDWR because of "
|
||||||
"unsupported optional features (%x).\n",
|
"unsupported optional features (%x)",
|
||||||
sb->s_id, le32_to_cpu(features));
|
le32_to_cpu(features));
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -866,7 +874,8 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
|
|
||||||
if (ext2_use_xip(sb) && blocksize != PAGE_SIZE) {
|
if (ext2_use_xip(sb) && blocksize != PAGE_SIZE) {
|
||||||
if (!silent)
|
if (!silent)
|
||||||
printk("XIP: Unsupported blocksize\n");
|
ext2_msg(sb, KERN_ERR,
|
||||||
|
"error: unsupported blocksize for xip");
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -875,7 +884,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
|
|
||||||
if (!sb_set_blocksize(sb, blocksize)) {
|
if (!sb_set_blocksize(sb, blocksize)) {
|
||||||
printk(KERN_ERR "EXT2-fs: blocksize too small for device.\n");
|
ext2_msg(sb, KERN_ERR, "error: blocksize is too small");
|
||||||
goto failed_sbi;
|
goto failed_sbi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -883,14 +892,14 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
offset = (sb_block*BLOCK_SIZE) % blocksize;
|
offset = (sb_block*BLOCK_SIZE) % blocksize;
|
||||||
bh = sb_bread(sb, logic_sb_block);
|
bh = sb_bread(sb, logic_sb_block);
|
||||||
if(!bh) {
|
if(!bh) {
|
||||||
printk("EXT2-fs: Couldn't read superblock on "
|
ext2_msg(sb, KERN_ERR, "error: couldn't read"
|
||||||
"2nd try.\n");
|
"superblock on 2nd try");
|
||||||
goto failed_sbi;
|
goto failed_sbi;
|
||||||
}
|
}
|
||||||
es = (struct ext2_super_block *) (((char *)bh->b_data) + offset);
|
es = (struct ext2_super_block *) (((char *)bh->b_data) + offset);
|
||||||
sbi->s_es = es;
|
sbi->s_es = es;
|
||||||
if (es->s_magic != cpu_to_le16(EXT2_SUPER_MAGIC)) {
|
if (es->s_magic != cpu_to_le16(EXT2_SUPER_MAGIC)) {
|
||||||
printk ("EXT2-fs: Magic mismatch, very weird !\n");
|
ext2_msg(sb, KERN_ERR, "error: magic mismatch");
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -906,7 +915,8 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
if ((sbi->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE) ||
|
if ((sbi->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE) ||
|
||||||
!is_power_of_2(sbi->s_inode_size) ||
|
!is_power_of_2(sbi->s_inode_size) ||
|
||||||
(sbi->s_inode_size > blocksize)) {
|
(sbi->s_inode_size > blocksize)) {
|
||||||
printk ("EXT2-fs: unsupported inode size: %d\n",
|
ext2_msg(sb, KERN_ERR,
|
||||||
|
"error: unsupported inode size: %d",
|
||||||
sbi->s_inode_size);
|
sbi->s_inode_size);
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
|
@ -943,29 +953,33 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
|
|
||||||
if (sb->s_blocksize != bh->b_size) {
|
if (sb->s_blocksize != bh->b_size) {
|
||||||
if (!silent)
|
if (!silent)
|
||||||
printk ("VFS: Unsupported blocksize on dev "
|
ext2_msg(sb, KERN_ERR, "error: unsupported blocksize");
|
||||||
"%s.\n", sb->s_id);
|
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sb->s_blocksize != sbi->s_frag_size) {
|
if (sb->s_blocksize != sbi->s_frag_size) {
|
||||||
printk ("EXT2-fs: fragsize %lu != blocksize %lu (not supported yet)\n",
|
ext2_msg(sb, KERN_ERR,
|
||||||
|
"error: fragsize %lu != blocksize %lu"
|
||||||
|
"(not supported yet)",
|
||||||
sbi->s_frag_size, sb->s_blocksize);
|
sbi->s_frag_size, sb->s_blocksize);
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sbi->s_blocks_per_group > sb->s_blocksize * 8) {
|
if (sbi->s_blocks_per_group > sb->s_blocksize * 8) {
|
||||||
printk ("EXT2-fs: #blocks per group too big: %lu\n",
|
ext2_msg(sb, KERN_ERR,
|
||||||
|
"error: #blocks per group too big: %lu",
|
||||||
sbi->s_blocks_per_group);
|
sbi->s_blocks_per_group);
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
if (sbi->s_frags_per_group > sb->s_blocksize * 8) {
|
if (sbi->s_frags_per_group > sb->s_blocksize * 8) {
|
||||||
printk ("EXT2-fs: #fragments per group too big: %lu\n",
|
ext2_msg(sb, KERN_ERR,
|
||||||
|
"error: #fragments per group too big: %lu",
|
||||||
sbi->s_frags_per_group);
|
sbi->s_frags_per_group);
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
if (sbi->s_inodes_per_group > sb->s_blocksize * 8) {
|
if (sbi->s_inodes_per_group > sb->s_blocksize * 8) {
|
||||||
printk ("EXT2-fs: #inodes per group too big: %lu\n",
|
ext2_msg(sb, KERN_ERR,
|
||||||
|
"error: #inodes per group too big: %lu",
|
||||||
sbi->s_inodes_per_group);
|
sbi->s_inodes_per_group);
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
|
@ -979,13 +993,13 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
EXT2_DESC_PER_BLOCK(sb);
|
EXT2_DESC_PER_BLOCK(sb);
|
||||||
sbi->s_group_desc = kmalloc (db_count * sizeof (struct buffer_head *), GFP_KERNEL);
|
sbi->s_group_desc = kmalloc (db_count * sizeof (struct buffer_head *), GFP_KERNEL);
|
||||||
if (sbi->s_group_desc == NULL) {
|
if (sbi->s_group_desc == NULL) {
|
||||||
printk ("EXT2-fs: not enough memory\n");
|
ext2_msg(sb, KERN_ERR, "error: not enough memory");
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
}
|
}
|
||||||
bgl_lock_init(sbi->s_blockgroup_lock);
|
bgl_lock_init(sbi->s_blockgroup_lock);
|
||||||
sbi->s_debts = kcalloc(sbi->s_groups_count, sizeof(*sbi->s_debts), GFP_KERNEL);
|
sbi->s_debts = kcalloc(sbi->s_groups_count, sizeof(*sbi->s_debts), GFP_KERNEL);
|
||||||
if (!sbi->s_debts) {
|
if (!sbi->s_debts) {
|
||||||
printk ("EXT2-fs: not enough memory\n");
|
ext2_msg(sb, KERN_ERR, "error: not enough memory");
|
||||||
goto failed_mount_group_desc;
|
goto failed_mount_group_desc;
|
||||||
}
|
}
|
||||||
for (i = 0; i < db_count; i++) {
|
for (i = 0; i < db_count; i++) {
|
||||||
|
@ -994,12 +1008,13 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
if (!sbi->s_group_desc[i]) {
|
if (!sbi->s_group_desc[i]) {
|
||||||
for (j = 0; j < i; j++)
|
for (j = 0; j < i; j++)
|
||||||
brelse (sbi->s_group_desc[j]);
|
brelse (sbi->s_group_desc[j]);
|
||||||
printk ("EXT2-fs: unable to read group descriptors\n");
|
ext2_msg(sb, KERN_ERR,
|
||||||
|
"error: unable to read group descriptors");
|
||||||
goto failed_mount_group_desc;
|
goto failed_mount_group_desc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!ext2_check_descriptors (sb)) {
|
if (!ext2_check_descriptors (sb)) {
|
||||||
printk ("EXT2-fs: group descriptors corrupted!\n");
|
ext2_msg(sb, KERN_ERR, "group descriptors corrupted");
|
||||||
goto failed_mount2;
|
goto failed_mount2;
|
||||||
}
|
}
|
||||||
sbi->s_gdb_count = db_count;
|
sbi->s_gdb_count = db_count;
|
||||||
|
@ -1032,7 +1047,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
ext2_count_dirs(sb));
|
ext2_count_dirs(sb));
|
||||||
}
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
printk(KERN_ERR "EXT2-fs: insufficient memory\n");
|
ext2_msg(sb, KERN_ERR, "error: insufficient memory");
|
||||||
goto failed_mount3;
|
goto failed_mount3;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -1048,27 +1063,28 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
}
|
}
|
||||||
if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) {
|
if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) {
|
||||||
iput(root);
|
iput(root);
|
||||||
printk(KERN_ERR "EXT2-fs: corrupt root inode, run e2fsck\n");
|
ext2_msg(sb, KERN_ERR, "error: corrupt root inode, run e2fsck");
|
||||||
goto failed_mount3;
|
goto failed_mount3;
|
||||||
}
|
}
|
||||||
|
|
||||||
sb->s_root = d_alloc_root(root);
|
sb->s_root = d_alloc_root(root);
|
||||||
if (!sb->s_root) {
|
if (!sb->s_root) {
|
||||||
iput(root);
|
iput(root);
|
||||||
printk(KERN_ERR "EXT2-fs: get root inode failed\n");
|
ext2_msg(sb, KERN_ERR, "error: get root inode failed");
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto failed_mount3;
|
goto failed_mount3;
|
||||||
}
|
}
|
||||||
if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL))
|
if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL))
|
||||||
ext2_warning(sb, __func__,
|
ext2_msg(sb, KERN_WARNING,
|
||||||
"mounting ext3 filesystem as ext2");
|
"warning: mounting ext3 filesystem as ext2");
|
||||||
ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY);
|
ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
cantfind_ext2:
|
cantfind_ext2:
|
||||||
if (!silent)
|
if (!silent)
|
||||||
printk("VFS: Can't find an ext2 filesystem on dev %s.\n",
|
ext2_msg(sb, KERN_ERR,
|
||||||
sb->s_id);
|
"error: can't find an ext2 filesystem on dev %s.",
|
||||||
|
sb->s_id);
|
||||||
goto failed_mount;
|
goto failed_mount;
|
||||||
failed_mount3:
|
failed_mount3:
|
||||||
percpu_counter_destroy(&sbi->s_freeblocks_counter);
|
percpu_counter_destroy(&sbi->s_freeblocks_counter);
|
||||||
|
@ -1170,7 +1186,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
|
||||||
/*
|
/*
|
||||||
* Allow the "check" option to be passed as a remount option.
|
* Allow the "check" option to be passed as a remount option.
|
||||||
*/
|
*/
|
||||||
if (!parse_options (data, sbi)) {
|
if (!parse_options(data, sb)) {
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto restore_opts;
|
goto restore_opts;
|
||||||
}
|
}
|
||||||
|
@ -1182,7 +1198,8 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
|
||||||
EXT2_MOUNT_XIP if not */
|
EXT2_MOUNT_XIP if not */
|
||||||
|
|
||||||
if ((ext2_use_xip(sb)) && (sb->s_blocksize != PAGE_SIZE)) {
|
if ((ext2_use_xip(sb)) && (sb->s_blocksize != PAGE_SIZE)) {
|
||||||
printk("XIP: Unsupported blocksize\n");
|
ext2_msg(sb, KERN_WARNING,
|
||||||
|
"warning: unsupported blocksize for xip");
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto restore_opts;
|
goto restore_opts;
|
||||||
}
|
}
|
||||||
|
@ -1191,8 +1208,8 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
|
||||||
if (((sbi->s_mount_opt & EXT2_MOUNT_XIP) !=
|
if (((sbi->s_mount_opt & EXT2_MOUNT_XIP) !=
|
||||||
(old_mount_opt & EXT2_MOUNT_XIP)) &&
|
(old_mount_opt & EXT2_MOUNT_XIP)) &&
|
||||||
invalidate_inodes(sb)) {
|
invalidate_inodes(sb)) {
|
||||||
ext2_warning(sb, __func__, "refusing change of xip flag "
|
ext2_msg(sb, KERN_WARNING, "warning: refusing change of "
|
||||||
"with busy inodes while remounting");
|
"xip flag with busy inodes while remounting");
|
||||||
sbi->s_mount_opt &= ~EXT2_MOUNT_XIP;
|
sbi->s_mount_opt &= ~EXT2_MOUNT_XIP;
|
||||||
sbi->s_mount_opt |= old_mount_opt & EXT2_MOUNT_XIP;
|
sbi->s_mount_opt |= old_mount_opt & EXT2_MOUNT_XIP;
|
||||||
}
|
}
|
||||||
|
@ -1216,9 +1233,10 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
|
||||||
__le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb,
|
__le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb,
|
||||||
~EXT2_FEATURE_RO_COMPAT_SUPP);
|
~EXT2_FEATURE_RO_COMPAT_SUPP);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printk("EXT2-fs: %s: couldn't remount RDWR because of "
|
ext2_msg(sb, KERN_WARNING,
|
||||||
"unsupported optional features (%x).\n",
|
"warning: couldn't remount RDWR because of "
|
||||||
sb->s_id, le32_to_cpu(ret));
|
"unsupported optional features (%x).",
|
||||||
|
le32_to_cpu(ret));
|
||||||
err = -EROFS;
|
err = -EROFS;
|
||||||
goto restore_opts;
|
goto restore_opts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,8 +69,9 @@ void ext2_xip_verify_sb(struct super_block *sb)
|
||||||
if ((sbi->s_mount_opt & EXT2_MOUNT_XIP) &&
|
if ((sbi->s_mount_opt & EXT2_MOUNT_XIP) &&
|
||||||
!sb->s_bdev->bd_disk->fops->direct_access) {
|
!sb->s_bdev->bd_disk->fops->direct_access) {
|
||||||
sbi->s_mount_opt &= (~EXT2_MOUNT_XIP);
|
sbi->s_mount_opt &= (~EXT2_MOUNT_XIP);
|
||||||
ext2_warning(sb, __func__,
|
ext2_msg(sb, KERN_WARNING,
|
||||||
"ignoring xip option - not supported by bdev");
|
"warning: ignoring xip option - "
|
||||||
|
"not supported by bdev");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue