xfs_extlen_t            len,    /* length of extent */
        int                     *stat)  /* success/failure */
 {
+       int                     error;
+
        cur->bc_rec.a.ar_startblock = bno;
        cur->bc_rec.a.ar_blockcount = len;
-       return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
+       error = xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
+       cur->bc_private.a.priv.abt.active = (*stat == 1);
+       return error;
 }
 
 /*
        xfs_extlen_t            len,    /* length of extent */
        int                     *stat)  /* success/failure */
 {
+       int                     error;
+
        cur->bc_rec.a.ar_startblock = bno;
        cur->bc_rec.a.ar_blockcount = len;
-       return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat);
+       error = xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat);
+       cur->bc_private.a.priv.abt.active = (*stat == 1);
+       return error;
 }
 
 /*
        xfs_extlen_t            len,    /* length of extent */
        int                     *stat)  /* success/failure */
 {
+       int                     error;
        cur->bc_rec.a.ar_startblock = bno;
        cur->bc_rec.a.ar_blockcount = len;
-       return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat);
+       error = xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat);
+       cur->bc_private.a.priv.abt.active = (*stat == 1);
+       return error;
+}
+
+static inline bool
+xfs_alloc_cur_active(
+       struct xfs_btree_cur    *cur)
+{
+       return cur && cur->bc_private.a.priv.abt.active;
 }
 
 /*