2008-05-25 15:35:14

by Christian Kujau

[permalink] [raw]
Subject: bh_count undeclared

Hi,

while trying to build the current e2fsprogs.pu git tree, I got:

# CFLAGS="-g" ./configure --prefix=/opt/e2fsprogs --enable-htree
# make
[....]
making all in e2fsck
make[2]: Entering directory `/data/Scratch/scm/e2fsprogs-git/e2fsck'
CC journal.c
journal.c: In function ‘getblk’:
journal.c:76: error: ‘bh_count’ undeclared (first use in this function)
journal.c:76: error: (Each undeclared identifier is reported only once
journal.c:76: error: for each function it appears in.)
make[2]: *** [journal.o] Error 1
make[2]: Leaving directory `/data/Scratch/scm/e2fsprogs-git/e2fsck'
make[1]: *** [all-progs-recursive] Error 1
make[1]: Leaving directory `/data/Scratch/scm/e2fsprogs-git'
make: *** [all] Error 2

When looking at journal.c I see 'bh_count' declared within an #ifdef, but
even when compiling with --enable-jfs-debug the error persists. Right now
I just removed the #ifdef so that the build succeeds.

But, what's the real issue here?

Thanks,
Christian.
--
BOFH excuse #331:

those damn raccoons!


2008-05-25 23:38:33

by Theodore Ts'o

[permalink] [raw]
Subject: Re: bh_count undeclared

On Sun, May 25, 2008 at 05:35:12PM +0200, Christian Kujau wrote:
> Hi,
>
> while trying to build the current e2fsprogs.pu git tree, I got:
>
> journal.c: In function ‘getblk’:
> journal.c:76: error: ‘bh_count’ undeclared (first use in this function)
>
> When looking at journal.c I see 'bh_count' declared within an #ifdef, but
> even when compiling with --enable-jfs-debug the error persists. Right now I
> just removed the #ifdef so that the build succeeds.
>
> But, what's the real issue here?

Whoops, my bad. I was compiling with --enable-jfs-debug, and I didn't
notice the change I made broke things without that configuration
option.

The right fix is just to surround the bh_count reference with an
#ifdef CONFIG_JBD_DEBUG.

It's part of a quickie mechanism for detecting buffer head leaks,
which (for example) was how I detected a problem in ext4's journal
checksum recovery code. I had made some changes to how it worked
while I was tracking down the problem, and accidentally introduced
that compile time bug. My bad, I'll fix it.

- Ted

2008-05-26 00:19:14

by Christian Kujau

[permalink] [raw]
Subject: Re: bh_count undeclared

On Sun, 25 May 2008, Theodore Tso wrote:
> Whoops, my bad. I was compiling with --enable-jfs-debug, and I didn't
> notice the change I made broke things without that configuration
> option.

But even *with* --enable-jfs-debug the error occured.

> The right fix is just to surround the bh_count reference with an
> #ifdef CONFIG_JBD_DEBUG.

Right now the declaration of bh_count is surrounded with an #ifdef:

#ifdef CONFIG_JBD_DEBUG /* Enabled by configure --enable-jfs-debug */
static int bh_count = 0;
#endif

But you want the refence surrounded by this #ifdef, right?

Thanks,
Christian.
--
BOFH excuse #192:

runaway cat on system.

2008-05-26 01:05:48

by Theodore Ts'o

[permalink] [raw]
Subject: Re: bh_count undeclared

On Mon, May 26, 2008 at 02:19:10AM +0200, Christian Kujau wrote:
> On Sun, 25 May 2008, Theodore Tso wrote:
>> Whoops, my bad. I was compiling with --enable-jfs-debug, and I didn't
>> notice the change I made broke things without that configuration
>> option.
>
> But even *with* --enable-jfs-debug the error occured.
>

Hmm... it shouldn't have. It certainly works for me.

>> The right fix is just to surround the bh_count reference with an
>> #ifdef CONFIG_JBD_DEBUG.
>
> Right now the declaration of bh_count is surrounded with an #ifdef:
>
> But you want the refence surrounded by this #ifdef, right?

Yes, that's what I said.

Or grab the latest 'pu' branch that I pushed. That should fix things
for you.

- Ted

2008-05-26 02:00:27

by Christian Kujau

[permalink] [raw]
Subject: Re: bh_count undeclared

On Sun, 25 May 2008, Theodore Tso wrote:
> Or grab the latest 'pu' branch that I pushed. That should fix things
> for you.

Great, compiling the pu branch works now :-)

Thanks,
Christian.
--
BOFH excuse #413:

Cow-tippers tipped a cow onto the server.