linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] e2fsprogs: introduce ext2fs_close_free() helper
Date: Sat, 5 Jul 2014 21:07:05 -0400	[thread overview]
Message-ID: <20140706010705.GB19036@thunk.org> (raw)
In-Reply-To: <1392908549-32318-1-git-send-email-lczerner@redhat.com>

On Thu, Feb 20, 2014 at 04:02:29PM +0100, Lukas Czerner wrote:
> Currently there are many uses of ext2fs_close() which might be wrong.
> First of all ext2fs_close() does not set the ext2_filsys pointer to NULL
> so the caller is responsible for clearing it, however there are some
> cases there we do not do it.
> 
> Second of all very small number of users of ext2fs_close() actually
> check the return value. If there is a problem in ext2fs_close() it will
> not even free the ext2_filsys structure, but majority of users expect it
> to do so.
> 
> To fix both problems this commit introduces a new helper
> ext2fs_close_free() which will not only check for the return value and
> free the ext2_filsys structure if the call to ext2fs_close2() failed,
> but it will also set the ext2_filsys pointer to NULL.
> 
> Replace every use of ext2fs_close() in e2fsprogs tools with
> ext2fs_close_free() - there is no real reason to keep using
> ext2fs_close().
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Thanks, applied.

					- Ted

      parent reply	other threads:[~2014-07-06  1:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 15:02 [PATCH] e2fsprogs: introduce ext2fs_close_free() helper Lukas Czerner
2014-02-20 19:39 ` Darrick J. Wong
2014-03-03 12:54   ` Lukáš Czerner
2014-07-06  1:07 ` Theodore Ts'o [this message]

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=20140706010705.GB19036@thunk.org \
    --to=tytso@mit.edu \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).