GFS2: Replace assertion with proper error handling
One fewer assert, one more place we can recover gracefully
if there is an error.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 3d0193a..c681c54 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -1561,7 +1561,9 @@
rgd->rd_last_alloc = blk;
block = rgd->rd_data0 + blk;
- gfs2_assert_withdraw(sdp, rgd->rd_free);
+ if (rgd->rd_free == 0)
+ goto rgrp_error;
+
rgd->rd_free--;
rgd->rd_dinodes++;
*generation = rgd->rd_igeneration++;