--- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -439,8 +439,13 @@ 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)) - goto corrupt; + 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); + height = GFS2_MAX_META_HEIGHT - 1; + } ip->i_height = (u8)height; depth = be16_to_cpu(str->di_depth); --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -895,8 +895,12 @@ static int __gfs2_iomap_get(struct inode *inode, loff_t pos, loff_t length, iomap->length = len << inode->i_blkbits; height = ip->i_height; - while ((lblock + 1) * sdp->sd_sb.sb_bsize > sdp->sd_heightsize[height]) + while (height < GFS2_MAX_META_HEIGHT && + (lblock + 1) * sdp->sd_sb.sb_bsize > sdp->sd_heightsize[height]) { + printk("lblock:%d, height:%d, sb_bsize: %d, heightsize:%d\n", + lblock, height, sdp->sd_sb.sb_bsize, sdp->sd_heightsize[height]); height++; + } find_metapath(sdp, lblock, mp, height); if (height > ip->i_height || gfs2_is_stuffed(ip)) goto do_alloc; --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -736,6 +736,7 @@ static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) { struct list_head *head; struct gfs2_bufdata *bd; + int i = 0; if (tr == NULL) return; @@ -745,6 +746,8 @@ static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_trans *tr) bd = list_first_entry(head, struct gfs2_bufdata, bd_list); list_del_init(&bd->bd_list); gfs2_unpin(sdp, bd->bd_bh, tr); + i++; + printk("buf_lo_after_commit: %d\n", i); } }