From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id p8T0xnAx150313 for ; Wed, 28 Sep 2011 19:59:50 -0500 Date: Wed, 28 Sep 2011 20:59:46 -0400 From: Christoph Hellwig Subject: Re: [PATCH 1/5] xfsprogs: libxcmd: don't clobber fs_table on realloc() Message-ID: <20110929005946.GA26863@infradead.org> References: <1317207432-8464-1-git-send-email-aelder@sgi.com> <08dbe8c3d0f49bac0c18570a68e7aa983cb4c731.1317207144.git.aelder@sgi.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <08dbe8c3d0f49bac0c18570a68e7aa983cb4c731.1317207144.git.aelder@sgi.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Alex Elder Cc: xfs@oss.sgi.com On Wed, Sep 28, 2011 at 05:57:08AM -0500, Alex Elder wrote: > In fs_table_insert(), realloc() is called to resize the global > fs_table. If it fails, it overwrites a previously valid fs_table > pointer with NULL. > > Instead, assign the return value to a local temporary and overwrite > fs_table only if the realloc() call succeeds. The only defined > errno value for a realloc() failure is ENOMEM, so return that > explicitly in the event it fails. Looks good. Did you encounter this issue in real life? Reviewed-by: Christoph Hellwig _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs