On Mar 15, 2008 03:20 +0100, Carlo Wood wrote:> The kernel headers define EXT3_ORPHAN_FS
> while libext2fs header defines EXT4_ORPHAN_FS
>
> This means that one of the two is wrong.
That isn't necessarily a correct assumption. All of the definitions in
the fs/ext3 code are EXT3_*, and similarly, all of the definitions in
fs/ext2 are EXT2_*, and in fs/ext4 they are EXT4_*. This avoids name
conflicts.
Conversely (though I don't necessarily agree with this) the definitions
in libext2fs declare these flags depending on what "version" of extN
the feature was first added (EXT2_*, EXT3_*, EXT4_*). That makes it
easier to see what kernel is using which feature, but isn't always 100%
accurate or correct.
> Does ext3 use/have EXT3_ORPHAN_FS, or that
> something that is new in ext4?
Note that EXT3_ORPHAN_FS isn't an on disk format or feature at all,
but just an in-memory state flag to convey the fact that the filesystem
is just being mounted and orphans are being cleaned up down to lower
levels of the code that are reading the inodes from disk. Otherwise,
the low level ext3_read_inode() will consider inodes with i_nlink == 0
to be unlinked and return a bad inode to the caller, to avoid issues
with NFS trying to access inodes that were deleted.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.