Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755578AbZIJKcf (ORCPT ); Thu, 10 Sep 2009 06:32:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753036AbZIJKcd (ORCPT ); Thu, 10 Sep 2009 06:32:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7306 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755461AbZIJK3p (ORCPT ); Thu, 10 Sep 2009 06:29:45 -0400 From: Steven Whitehouse To: linux-kernel@vger.kernel.org, cluster-devel@redhat.com Cc: Steven Whitehouse Subject: [PATCH 04/15] GFS2: Replace assertion with proper error handling Date: Thu, 10 Sep 2009 12:27:56 +0100 Message-Id: <1252582087-10007-5-git-send-email-swhiteho@redhat.com> In-Reply-To: <1252582087-10007-4-git-send-email-swhiteho@redhat.com> References: <1252582087-10007-1-git-send-email-swhiteho@redhat.com> <1252582087-10007-2-git-send-email-swhiteho@redhat.com> <1252582087-10007-3-git-send-email-swhiteho@redhat.com> <1252582087-10007-4-git-send-email-swhiteho@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 914 Lines: 31 One fewer assert, one more place we can recover gracefully if there is an error. Signed-off-by: Steven Whitehouse --- fs/gfs2/rgrp.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 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 @@ int gfs2_alloc_di(struct gfs2_inode *dip, u64 *bn, u64 *generation) 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++; -- 1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/