linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 1/4] e2fsprogs/libext2fs: replace ext2fs_free_inode_cache() argument
Date: Tue, 11 Nov 2014 11:12:11 -0500	[thread overview]
Message-ID: <20141111161211.GB17027@thunk.org> (raw)
In-Reply-To: <20141111081451.GD10043@birch.djwong.org>

On Tue, Nov 11, 2014 at 12:14:51AM -0800, Darrick J. Wong wrote:
> Ideally you'd change the old function to return an error code, but it returns
> void... sigh.  I guess client programs are on their own.
> 
> Really, free_inode_cache is a poor interface since the ctor doesn't return a
> struct ext2_inode_cache * directly, preferring to attach it to fs->icache
> instead.  Why are the inode cache ctor/dtor exported in ext2fs.h anyway?
> Nobody seems to use them.  Ted?

Looking at the history, the change happened in commit 603e5ebc, which
changed the internal representation of the ext2_inode_cache.  At that
point, I moved the inode cache freeing function from
lib/ext2fs/freefs.c to lib/ext2fs/inode.c, on the theory that it made
more sense to keep all of the code that handled the representation of
the inode cache was kept in the same place.

I agree I should have declared the function in ext2fsP.h instead of
ext2fs.h; the interface was not great, but that was probably because
it was originally intended as an internal interface, and I didn't
bother to fix it up before moving it function to another .c file.

At this point, we have a couple of choices.  

(1) define a new interface with a new name (ext2fs_free_inode_cache2)

(2) move the function back to freefs.c and make it be static, so that
the function signature disappears from the shared library.

(3) ignore the problem because it's highly unlikely anyone outside of
libext2fs will need to use it, and improving the API/ABI doesn't
really matter all that much.  Instead, just change the callers to
clear fs->icache after calling ext2fs_free_inode_cache().

My preference is (2) or (3).

Cheers,

						- Ted

  parent reply	other threads:[~2014-11-11 16:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11  6:59 [PATCH 1/4] e2fsprogs/libext2fs: replace ext2fs_free_inode_cache() argument Xiaoguang Wang
2014-11-11  6:59 ` [PATCH 2/4] e2fsprogs/tune2fs: fix memory leak in inode_scan_and_fix() Xiaoguang Wang
2014-11-11  6:59 ` [PATCH 3/4] e2fsprogs/tune2fs: rewrite metadata checksums when resizing inode size Xiaoguang Wang
2014-11-11  8:33   ` Darrick J. Wong
2014-11-11  9:08     ` Xiaoguang Wang
2014-11-12 21:30       ` Darrick J. Wong
2014-11-11  6:59 ` [PATCH 4/4] e2fsprogs/tune2fs: fix memory write overflow Xiaoguang Wang
2014-11-11  8:37   ` Darrick J. Wong
2014-11-11  8:14 ` [PATCH 1/4] e2fsprogs/libext2fs: replace ext2fs_free_inode_cache() argument Darrick J. Wong
2014-11-11  9:49   ` Xiaoguang Wang
2014-11-11 16:12   ` Theodore Ts'o [this message]
2014-11-12  9:38     ` Xiaoguang Wang

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=20141111161211.GB17027@thunk.org \
    --to=tytso@mit.edu \
    --cc=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=wangxg.fnst@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).