--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -90,10 +90,6 @@ int __ext4_check_dir_entry(const char *f
else
return 0;
- /* for debugging, sangwoo2.lee */
- print_bh(dir->i_sb, bh, 0, EXT4_BLOCK_SIZE(dir->i_sb));
- /* for debugging */
-
if (filp)
ext4_error_file(filp, function, line, bh ? bh->b_blocknr : 0,
"bad entry in directory: %s - offset=%u(%u), "
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1931,11 +1931,6 @@ extern __le16 ext4_group_desc_csum(struc
struct ext4_group_desc *gdp);
extern int ext4_group_desc_csum_verify(struct ext4_sb_info *sbi, __u32 group,
struct ext4_group_desc *gdp);
-/* for debugging, sangwoo2.lee */
-extern void print_bh(struct super_block *sb, struct buffer_head *bh, int start, int len);
-extern void print_block_data(struct super_block *sb, sector_t blocknr, unsigned char *data_to_dump, int start, int len);
-/* for debugging */
-
static inline ext4_fsblk_t ext4_blocks_count(struct ext4_super_block *es)
{
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -285,12 +285,8 @@ out:
if (!fatal)
fatal = err;
ext4_mark_super_dirty(sb);
- } else {
- /* for debugging, sangwoo2.lee */
- print_bh(sb, bitmap_bh, 0, EXT4_BLOCK_SIZE(sb));
- /* for debugging */
+ } else
ext4_error(sb, "bit already cleared for inode %lu", ino);
- }
error_return:
brelse(bitmap_bh);
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1182,11 +1182,6 @@ static int __check_block_validity(struct
{
if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk,
map->m_len)) {
- /* for debugging, sangwoo2.lee */
- printk(KERN_ERR "printing inode..\n");
- print_block_data(inode->i_sb, 0, (unsigned char *)inode, 0, EXT4_INODE_SIZE(inode->i_sb));
- /* for debugging */
-
ext4_error_inode(inode, func, line, map->m_pblk,
"lblock %lu mapped to illegal pblock "
"(length %d)", (unsigned long) map->m_lblk,
@@ -4942,12 +4937,6 @@ struct inode *ext4_iget(struct super_blo
if (inode->i_mode == 0 ||
!(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_ORPHAN_FS)) {
/* this inode is deleted */
- /* for debugging, sangwoo2.lee */
- printk(KERN_ERR "iloc info, offset : %lu, group# : %u\n", iloc.offset, iloc.block_group);
- printk(KERN_ERR "sb info, inodes per group : %lu, inode size : %d\n", EXT4_SB(sb)->s_inodes_per_group, EXT4_SB(sb)->s_inode_size);
- print_bh(sb, iloc.bh, 0, EXT4_BLOCK_SIZE(sb));
- /* for debugging */
-
ret = -ESTALE;
goto bad_inode;
}
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -731,10 +731,6 @@ void ext4_mb_generate_buddy(struct super
grp->bb_fragments = fragments;
if (free != grp->bb_free) {
- /* for more specific debugging, sangwoo2.lee */
- print_block_data(sb, 0, bitmap, 0, EXT4_BLOCK_SIZE(sb));
- /* for more specific debugging */
-
ext4_grp_locked_error(sb, group, 0, 0,
"%u blocks in bitmap, %u in gd",
free, grp->bb_free);
@@ -1342,9 +1338,6 @@ static void mb_free_blocks(struct inode
blocknr = ext4_group_first_block_no(sb, e4b->bd_group);
blocknr += block;
- /* for debugging, sangwoo2.lee */
- print_block_data(sb, blocknr, EXT4_MB_BITMAP(e4b), 0, EXT4_BLOCK_SIZE(sb));
- /* for debugging */
ext4_grp_locked_error(sb, e4b->bd_group,
inode ? inode->i_ino : 0,
blocknr,
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1031,25 +1031,17 @@ static struct dentry *ext4_lookup(struct
inode = NULL;
if (bh) {
__u32 ino = le32_to_cpu(de->inode);
+ brelse(bh);
if (!ext4_valid_inum(dir->i_sb, ino)) {
- /* for debugging, sangwoo2.lee */
- printk(KERN_ERR "Name of directory entry has bad inode# : %s\n", de->name);
- print_bh(dir->i_sb, bh, 0, EXT4_BLOCK_SIZE(dir->i_sb));
- /* for debugging */
- brelse(bh);
-
EXT4_ERROR_INODE(dir, "bad inode number: %u", ino);
return ERR_PTR(-EIO);
}
- brelse(bh);
-
inode = ext4_iget(dir->i_sb, ino);
if (IS_ERR(inode)) {
if (PTR_ERR(inode) == -ESTALE) {
- /* In case of -ESTALE, printing debugging data is already done in ext4_iget */
EXT4_ERROR_INODE(dir,
- "deleted inode referenced: %u at parent inode : %lu",
- ino, dir->i_ino);
+ "deleted inode referenced: %u",
+ ino);
return ERR_PTR(-EIO);
} else {
return ERR_CAST(inode);
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3619,7 +3619,8 @@ no_journal:
goto failed_mount4;
}
- ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY);
+ if (ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY))
+ sb->s_flags |= MS_RDONLY;
/* determine the minimum size of new large inodes, if present */
if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) {
@@ -3722,16 +3723,8 @@ no_journal:
return 0;
cantfind_ext4:
-
- /* for debugging, sangwoo2.lee */
- /* If you wanna use the flag 'MS_SILENT', call 'print_bh' function within below 'if'. */
- printk("printing data of superblock-bh\n");
- print_bh(sb, bh, 0, EXT4_BLOCK_SIZE(sb));
- /* for debugging */
-
if (!silent)
ext4_msg(sb, KERN_ERR, "VFS: Can't find ext4 filesystem");
-
goto failed_mount;
failed_mount4:
@@ -4830,55 +4823,6 @@ out:
#endif
-/* for debugging, sangwoo2.lee */
-void print_bh(struct super_block *sb, struct buffer_head *bh, int start, int len)
-{
- print_block_data(sb, bh->b_blocknr, bh->b_data, start, len);
-}
-
-void print_block_data(struct super_block *sb, sector_t blocknr, unsigned char *data_to_dump, int start, int len)
-{
- int i, j;
- int bh_offset = (start / 16) * 16;
- char row_data[17] = { 0, };
- char row_hex[50] = { 0, };
- char ch;
-
- printk(KERN_ERR "As EXT4-fs error, printing data in hex\n");
- printk(KERN_ERR " [partition info] s_id : %s, start block# : %llu\n", sb->s_id, sb->s_bdev->bd_part->start_sect);
- printk(KERN_ERR " dump block# : %llu, start offset(byte) : %d, length(byte) : %d\n", blocknr, start, len);
- printk(KERN_ERR "-----------------------------------------------------------------------------\n");
-
- for (i = 0; i < (len + 15) / 16; i++)
- {
- for (j = 0; j < 16; j++)
- {
- ch = *(data_to_dump + bh_offset + j);
- if (start <= bh_offset + j && start + len > bh_offset + j)
- {
- if (isascii(ch) && isprint(ch))
- sprintf(row_data + j, "%c", ch);
- else
- sprintf(row_data + j, ".");
-
- sprintf(row_hex + (j * 3), "%2.2x ", ch);
- }
- else
- {
- sprintf(row_data + j, " ");
- sprintf(row_hex + (j * 3), "-- ");
- }
- }
-
- printk(KERN_ERR "0x%4.4x : %s | %s\n", bh_offset, row_hex, row_data);
- bh_offset += 16;
-
- }
- printk(KERN_ERR "-----------------------------------------------------------------------------\n");
-}
-/* for debugging */
-
-
static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
const char *dev_name, void *data)
{
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2732,6 +2732,11 @@ struct vfsmount *kern_mount_data(struct
}
EXPORT_SYMBOL_GPL(kern_mount_data);
+bool our_mnt(struct vfsmount *mnt)
+{
+ return check_mnt(mnt);
+}
+
void kern_unmount(struct vfsmount *mnt)
{
/* release long term mount so mount point can be released */
@@ -2741,8 +2746,3 @@ void kern_unmount(struct vfsmount *mnt)
}
}
EXPORT_SYMBOL(kern_unmount);
-
-bool our_mnt(struct vfsmount *mnt)
-{
- return check_mnt(mnt);
-}