This patch changes some BUG_ON calls to GLOCK_BUG_ON so we get more
information to help with debugging when reservation problems occur.

Signed-off-by: Bob Peterson <rpete...@redhat.com>
---
 fs/gfs2/rgrp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 9b04a570c582..e14520b451db 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -49,7 +49,7 @@ static inline struct gfs2_bitmap *rbm_bi(const struct 
gfs2_rbm *rbm)
 
 static inline u64 gfs2_rbm_to_block(const struct gfs2_rbm *rbm)
 {
-       BUG_ON(rbm->offset >= rbm->rgd->rd_data);
+       GLOCK_BUG_ON(rbm->rgd->rd_gl, rbm->offset >= rbm->rgd->rd_data);
        return rbm->rgd->rd_data0 + (rbm_bi(rbm)->bi_start * GFS2_NBBY) +
                rbm->offset;
 }
@@ -1492,7 +1492,7 @@ static void rs_insert(struct gfs2_inode *ip)
        struct gfs2_blkreserv *rs = &ip->i_res;
        struct gfs2_rgrpd *rgd = rs->rs_rgd;
 
-       BUG_ON(gfs2_rs_active(rs));
+       GLOCK_BUG_ON(rgd->rd_gl, gfs2_rs_active(rs));
 
        spin_lock(&rgd->rd_rsspin);
        newn = &rgd->rd_rstree.rb_node;
@@ -2426,7 +2426,7 @@ int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, 
unsigned int *nblocks,
        u32 minext = 1;
        int error = -ENOSPC;
 
-       BUG_ON(ip->i_res.rs_reserved < *nblocks);
+       GLOCK_BUG_ON(rbm.rgd->rd_gl, ip->i_res.rs_reserved < *nblocks);
 
        rgrp_lock_local(rbm.rgd);
        if (gfs2_rs_active(&ip->i_res)) {
-- 
2.34.1

Reply via email to