--- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -400,10 +400,14 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) struct inode *inode = &ip->i_inode; bool is_new = inode->i_state & I_NEW; - if (unlikely(ip->i_no_addr != be64_to_cpu(str->di_num.no_addr))) + if (unlikely(ip->i_no_addr != be64_to_cpu(str->di_num.no_addr))) { + WARN_ON_ONCE(1); goto corrupt; - if (unlikely(!is_new && inode_wrong_type(inode, mode))) + } + if (unlikely(!is_new && inode_wrong_type(inode, mode))) { + WARN_ON_ONCE(1); goto corrupt; + } ip->i_no_formal_ino = be64_to_cpu(str->di_num.no_formal_ino); inode->i_mode = mode; if (is_new) { @@ -439,18 +443,29 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) /* i_diskflags and i_eattr must be set before gfs2_set_inode_flags() */ gfs2_set_inode_flags(inode); height = be16_to_cpu(str->di_height); - if (unlikely(height > GFS2_MAX_META_HEIGHT)) + if (unlikely(height > GFS2_MAX_META_HEIGHT)) { + printk(KERN_INFO "buf->di_height: %d\n", height); + depth = be16_to_cpu(str->di_depth); + printk(KERN_INFO "buf->di_depth: %d\n", depth); + printk(KERN_INFO "inode->i_size: %d\n", inode->i_size); + WARN_ON_ONCE(1); goto corrupt; + } ip->i_height = (u8)height; depth = be16_to_cpu(str->di_depth); - if (unlikely(depth > GFS2_DIR_MAX_DEPTH)) + if (unlikely(depth > GFS2_DIR_MAX_DEPTH)) { + printk(KERN_INFO "buf->di_depth: %d\n", depth); + WARN_ON_ONCE(1); goto corrupt; + } ip->i_depth = (u8)depth; ip->i_entries = be32_to_cpu(str->di_entries); - if (gfs2_is_stuffed(ip) && inode->i_size > gfs2_max_stuffed_size(ip)) + if (gfs2_is_stuffed(ip) && inode->i_size > gfs2_max_stuffed_size(ip)) { + WARN_ON_ONCE(1); goto corrupt; + } if (S_ISREG(inode->i_mode)) gfs2_set_aops(inode);