linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Sami Liedes <sami.liedes@iki.fi>
Cc: Eric Sandeen <sandeen@redhat.com>,
	"Richard W.M. Jones" <rjones@redhat.com>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: Commit c1a1e7fc24d6 causes segfault in ext2fs_new_inode
Date: Fri, 6 Apr 2012 13:06:11 -0700	[thread overview]
Message-ID: <20120406200611.GA11295@thunk.org> (raw)
In-Reply-To: <20120406191401.GA8816@sli.dy.fi>

I was flying back from San Francisco so I decided to take a look at
this while I was flying back.  So my patches overlapped with yours....

I think mine will be a tad bit faster for the fallback path since we
don't end up doing the 32-bit/64-bit each time we test a bit (since I
created a 32-bit and 64-bit ffz function). 

On Fri, Apr 06, 2012 at 10:14:01PM +0300, Sami Liedes wrote:
> 
> Argh, indeed. I thought the 32-bit bitfields also have the bitmap_ops
> field (and in the same offset), but they don't.

Yeah, the only thing which is the same is the offset.  The structure
definition is in gen_bitmap.c and gen_bitmap64.c, and they are
different depending on whether it is a 32-bit or 64-bit bitmap.

> > I am a little confused by the existence of two different
> > struct ext2fs_struct_generic_bitmap's in the code.  But treating one as the
> > other looks doomed to failure ;)
> 
> In addition to that, there are actually three different versions of
> many operations; they are named ext2_foo_bmap(), ext2_foo_bitmap() and
> ext2_foo_bitmap2(). I'm quite confused too.

Well, actually there are four.  The original 32-bit code has generic
bitmap code that is where most of the implementation exists.  Then we
have separate versions for block and inode bitmaps for the purposes of
type checking.

Then in the 64-bit code, we have the same thing; generic versions plus
block/inode specific versions, plus of course the multiple different
back-end implementations.

I've added test cases to exercise all of this code, which should
prevent problems in the future.  I expect that after we add a
find_first_set function, it's unlikely we'll need to be touching the
bitmap implementations again for the near future....

       		       	     	     	  - Ted

  parent reply	other threads:[~2012-04-06 20:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30 12:57 Commit c1a1e7fc24d6 causes segfault in ext2fs_new_inode Richard W.M. Jones
2012-03-30 13:19 ` Richard W.M. Jones
2012-03-30 19:38   ` Eric Sandeen
2012-03-30 22:25     ` Eric Sandeen
2012-04-06 19:14     ` Sami Liedes
2012-04-06 19:19       ` Eric Sandeen
2012-04-06 19:31         ` Eric Sandeen
2012-04-06 19:47           ` Sami Liedes
2012-04-06 19:49             ` Eric Sandeen
2012-04-06 19:22       ` Richard W.M. Jones
2012-04-06 20:06       ` Ted Ts'o [this message]
2012-04-06 18:57   ` Ted Ts'o
2012-04-06 18:59     ` [PATCH 1/3] libext2fs: add 32-bit compat code for ext2fs_find_first_zero_generic_bmap() Theodore Ts'o
2012-04-06 18:59       ` [PATCH 2/3] libext2fs: use correct types in ext2fs_find_first_zero_block_bitmap2() Theodore Ts'o
2012-04-06 18:59       ` [PATCH 3/3] libext2fs: improve testing coverage of tst_bitmaps Theodore Ts'o
2012-04-09 16:14       ` [PATCH 1/3] libext2fs: add 32-bit compat code for ext2fs_find_first_zero_generic_bmap() Eric Sandeen
2012-04-05  3:56 ` Commit c1a1e7fc24d6 causes segfault in ext2fs_new_inode Eric Sandeen

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=20120406200611.GA11295@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=rjones@redhat.com \
    --cc=sami.liedes@iki.fi \
    --cc=sandeen@redhat.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).