public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Alex Elder <aelder@sgi.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/5] xfsprogs: libxcmd: don't clobber fs_table on realloc()
Date: Wed, 28 Sep 2011 20:59:46 -0400	[thread overview]
Message-ID: <20110929005946.GA26863@infradead.org> (raw)
In-Reply-To: <08dbe8c3d0f49bac0c18570a68e7aa983cb4c731.1317207144.git.aelder@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 <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2011-09-29  0:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28 10:57 [PATCH 0/5] xfsprogs: some libxcmd cleanups Alex Elder
2011-09-28 10:57 ` [PATCH 1/5] xfsprogs: libxcmd: don't clobber fs_table on realloc() Alex Elder
2011-09-28 10:57   ` [PATCH 2/5] xfsprogs: libxcmd: simplify fs_table_lookup() Alex Elder
2011-09-29  1:00     ` Christoph Hellwig
2011-09-28 10:57   ` [PATCH 3/5] xfsprogs: libxcmd: kill "search" arg in fs_device_number() Alex Elder
2011-09-29  1:01     ` Christoph Hellwig
2011-09-28 10:57   ` [PATCH 4/5] xfsprogs: libxcmd: move fs_device_number() up in the file Alex Elder
2011-09-29  1:01     ` Christoph Hellwig
2011-09-28 10:57   ` [PATCH 5/5] xfsprogs: libxcmd: use fs_device_number() consistently Alex Elder
2011-09-29  1:03     ` Christoph Hellwig
2011-09-29  0:59   ` Christoph Hellwig [this message]
2011-09-29 14:10     ` [PATCH 1/5] xfsprogs: libxcmd: don't clobber fs_table on realloc() Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110929005946.GA26863@infradead.org \
    --to=hch@infradead.org \
    --cc=aelder@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox