--- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -352,6 +352,7 @@ static int gfs2_read_sb(struct gfs2_sbd *sdp, int silent) } sdp->sd_max_height = x; sdp->sd_heightsize[x] = ~0; + printk("sdp->sd_max_height: %d\n", x); gfs2_assert(sdp, sdp->sd_max_height <= GFS2_MAX_META_HEIGHT); sdp->sd_max_dents_per_leaf = (sdp->sd_sb.sb_bsize - --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -895,8 +895,13 @@ 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]) + printk("ip->i_height: %d, i_ino: %d\n", height, ip->i_inode.i_ino); + 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,pos:%d,size:%d\n", + lblock, height, sdp->sd_sb.sb_bsize, sdp->sd_heightsize[height], pos, size); height++; + } find_metapath(sdp, lblock, mp, height); if (height > ip->i_height || gfs2_is_stuffed(ip)) goto do_alloc; --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -1362,6 +1362,7 @@ int gfs2_quota_init(struct gfs2_sbd *sdp) u64 dblock; u32 extlen = 0; int error; + u32 qcid = 0; if (gfs2_check_internal_file_size(sdp->sd_qc_inode, 1, 64 << 20)) return -EIO; @@ -1376,6 +1377,7 @@ int gfs2_quota_init(struct gfs2_sbd *sdp) __GFP_ZERO); if (!sdp->sd_quota_bitmap) return error; + qcid = ip->i_inode.i_ino; for (x = 0; x < blocks; x++) { struct buffer_head *bh; @@ -1442,7 +1444,7 @@ int gfs2_quota_init(struct gfs2_sbd *sdp) } if (found) - fs_info(sdp, "found %u quota changes\n", found); + fs_info(sdp, "found %u quota changes, i_ino:%d, i_height: %d\n", found, qcid, ip->i_height); return 0; @@ -1471,6 +1473,7 @@ void gfs2_quota_cleanup(struct gfs2_sbd *sdp) hlist_bl_del_rcu(&qd->qd_hlist); spin_unlock_bucket(qd->qd_hash); + fs_info(sdp, "qc_id:%d\n", cpu_to_be32(from_kqid(&init_user_ns, qd->qd_id))); gfs2_assert_warn(sdp, !qd->qd_change); gfs2_assert_warn(sdp, !qd->qd_slot_count); gfs2_assert_warn(sdp, !qd->qd_bh_count); --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -442,10 +442,17 @@ 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)) + printk("str->di_height:%d, ip->i_inode.i_ino: %d, ip->i_height:%d, %s", + height, ip->i_inode.i_ino, ip->i_height, __func__); + if (unlikely(height > GFS2_MAX_META_HEIGHT)) { + if (gfs2_is_stuffed(ip)) { + goto dem; + } goto corrupt; + } ip->i_height = (u8)height; +dem: depth = be16_to_cpu(str->di_depth); if (unlikely(depth > GFS2_DIR_MAX_DEPTH)) goto corrupt; --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -107,6 +107,10 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh, BUG_ON(!buffer_uptodate(bh)); BUG_ON(!buffer_pinned(bh)); + if (!atomic_read(sdp->sd_log_pinned)) { + printk("not pinned, %s", __func__); + return; + } lock_buffer(bh); mark_buffer_dirty(bh); clear_buffer_pinned(bh); @@ -736,12 +740,15 @@ 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; head = &tr->tr_buf; while (!list_empty(head)) { + i++; + printk("buf_lo_after_commit: %d\n", i); bd = list_first_entry(head, struct gfs2_bufdata, bd_list); list_del_init(&bd->bd_list); gfs2_unpin(sdp, bd->bd_bh, tr);