diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index 5713994328cb..5f8a11dcd2d2 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -2892,7 +2892,6 @@ static void dbAdjTree(dmtree_t *tp, int leafno, int newval, bool is_ctl) * group containing the specified leaf (leafno). */ lp = ((lp - 1) & ~0x03) + 1; - /* get the index of the parent of this 4 leaf group. */ pp = (lp - 1) >> 2; @@ -2911,6 +2910,10 @@ static void dbAdjTree(dmtree_t *tp, int leafno, int newval, bool is_ctl) */ tp->dmt_stree[pp] = max; + if (lp == 1) { + break; + } + /* parent becomes leaf for next go-round. */ lp = pp;