Skip to contentSkip to conversation

ext3 extended attributes refcounting wrong?

DISCUSSION Mikael Pettersson 4 participants 8 messages Feb 3, 2005 – Feb 4, 2005

lore
Share & tools
lore
#0 lore raw

I believe there is some accounting error in the ext3 code for the case when CONFIG_EXT3_FS_XATTR is not selected.

Whenever any one of my development boxes triggers an fsck at boot because some file system, usually /, has been mounted sufficiently many times, an inconsistency error occurs:

Extended attribute block N has reference count M, should be M'.

where M' is much less than M. As I drop into single-user and run fsck, it finds at lot occurrences of this error, followed by:

Block bitmap differences ...

and then:

Free blocks count wrong

(always too low, i.e. I have more free blocks than the fs records).

This occurs on all my boxes, with different CPUs (x86/x86-64/ppc) and different chipsets (Intel, Promise, VIA, Apple), and basically the only commonalities are:
- they dual boot the most recent 2.4 and 2.6 kernels, and I switch often
- all file systems are ext3
- all XATTR stuff is disabled

/Mikael

#1 lore raw

Hi,

Quoted 6 lines · Mikael Pettersson

I believe there is some accounting error in the ext3 code for the case when CONFIG_EXT3_FS_XATTR is not selected.

Whenever any one of my development boxes triggers an fsck at boot because some file system, usually /, has been mounted sufficiently many times, an inconsistency error occurs

In which kernel(s) exactly? There was a fix for that applied fairly recently upstream.

Quoted 8 lines

Extended attribute block N has reference count M, should be M'.

This occurs on all my boxes, with different CPUs (x86/x86-64/ppc) and different chipsets (Intel, Promise, VIA, Apple), and basically the only commonalities are:
- they dual boot the most recent 2.4 and 2.6 kernels, and I switch often
- all file systems are ext3
- all XATTR stuff is disabled

I'm not sure how you get this if all xattr stuff is disabled! Are you sure you're not using SELinux or ACLs, for example?

--Stephen

#2 lore raw
Quoted 6 lines · Stephen C. Tweedie

Hi,

Quoted 3 lines · Mikael Pettersson

I believe there is some accounting error in the ext3 code for the case when CONFIG_EXT3_FS_XATTR is not selected.

Quoted 6 lines
Quoted 3 lines

Whenever any one of my development boxes triggers an fsck at boot because some file system, usually /, has been mounted sufficiently many times, an inconsistency error occurs

In which kernel(s) exactly? There was a fix for that applied fairly recently upstream.

I've been seeing this over the last couple of months, with (at least) 2.4.28 and newer, and 2.6.9 and newer standard kernels. But since I dual boot and switch kernels often, I can't point at any given kernel or kernel series as being the culprit.

How recent was that fix? Maybe I'm seeing the aftereffects of pre-fix corruption?

Quoted 11 lines
Quoted 8 lines

Extended attribute block N has reference count M, should be M'.

This occurs on all my boxes, with different CPUs (x86/x86-64/ppc) and different chipsets (Intel, Promise, VIA, Apple), and basically the only commonalities are:
- they dual boot the most recent 2.4 and 2.6 kernels, and I switch often
- all file systems are ext3
- all XATTR stuff is disabled

I'm not sure how you get this if all xattr stuff is disabled! Are you sure you're not using SELinux or ACLs, for example?

Absolutely. I use no xattrs, ACLs, or SELinux at all, and I always disable those features in my kernels.

/Mikael

#3 lore raw

Hi,

Quoted 7 lines · Mikael Pettersson
Quoted 2 lines

In which kernel(s) exactly? There was a fix for that applied fairly recently upstream.

I've been seeing this over the last couple of months, with (at least) 2.4.28 and newer, and 2.6.9 and newer standard kernels. But since I dual boot and switch kernels often, I can't point at any given kernel or kernel series as being the culprit.

Plain upstream 2.4.28? If so, that's probably the trouble, as 2.4 doesn't have any xattr support, so if you delete a file on 2.4 it won't delete the xattr block for it.

Quoted 2 lines

How recent was that fix? Maybe I'm seeing the aftereffects of pre-fix corruption?

It went in on the 15th of January this year.

--Stephen

#4 lore raw
Quoted 7 lines · Stephen C. Tweedie

Hi,

Quoted 3 lines · Mikael Pettersson
Quoted 2 lines

In which kernel(s) exactly? There was a fix for that applied fairly recently upstream.

Quoted 8 lines
Quoted 4 lines

I've been seeing this over the last couple of months, with (at least) 2.4.28 and newer, and 2.6.9 and newer standard kernels. But since I dual boot and switch kernels often, I can't point at any given kernel or kernel series as being the culprit.

Plain upstream 2.4.28? If so, that's probably the trouble, as 2.4 doesn't have any xattr support, so if you delete a file on 2.4 it won't delete the xattr block for it.

2.4.28 - certainly I've used that at lot.

Quoted 4 lines
Quoted 2 lines

How recent was that fix? Maybe I'm seeing the aftereffects of pre-fix corruption?

It went in on the 15th of January this year.

Is it in 2.4.29?

/Mikael

#5 lore raw

Hi,

Quoted 5 lines · Mikael Pettersson
Quoted 3 lines

Plain upstream 2.4.28? If so, that's probably the trouble, as 2.4 doesn't have any xattr support, so if you delete a file on 2.4 it won't delete the xattr block for it.

2.4.28 - certainly I've used that at lot.

But plain upstream 2.4.28, or a vendor kernel? Like I just said, upstream doesn't have xattr support.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

How recent was that fix? Maybe I'm seeing the aftereffects of pre-fix corruption?

It went in on the 15th of January this year.

Is it in 2.4.29?

No, it couldn't be. It was an xattr fix. 2.4.29 doesn't have xattrs, so the fix isn't relevant there.

--Stephen

#6 lore raw
Quoted 4 lines · Stephen C. Tweedie

Hi,

On Fri, 2005-02-04 at 13:10, Mikael Pettersson wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Plain upstream 2.4.28? If so, that's probably the trouble, as 2.4 doesn't have any xattr support, so if you delete a file on 2.4 it won't delete the xattr block for it.

2.4.28 - certainly I've used that at lot.

But plain upstream 2.4.28, or a vendor kernel? Like I just said, upstream doesn't have xattr support.

Plain www.kernel.org kernels always.

/Mikael

#7 lore raw
Quoted 1 line · Mikael Pettersson

Plain www.kernel.org kernels always.

Good, it's no bug then. Stephen already explained what's going on: when a file has xattrs and you delete the file while running a kernel without xattr support, the xattr block's refcount is not decremented. You end up with a reference count that is one too high. This won't result in filesystem corruption, but e2fsck will fix up the refcounts for you. Those are the mesages you were getting.

Regards,

Signature · 2 lines
Andreas Gruenbacher <[email protected]>
SUSE Labs, SUSE LINUX GMBH