Re: Stop the Linux kernel madness

From: Andreas Dilger
Date: Fri Jun 18 2004 - 20:13:06 EST


On Jun 18, 2004 13:12 -0700, 4Front Technologies wrote:
> Andreas Dilger wrote:
> >We gave up trying to use kernel versions to determine what
> >features/interface
> >to use for a given kernel long ago. Instead we have configure check for a
> >particular interface and use "#ifdef HAVE_foo", not "#if
> >LINUX_KERNEL_VERSION".
> >
> >I can understand why SuSE does this - there is no way they can ship the
> >"latest" kernel and still have tested it thoroughly, yet if they find a
> >specific defect they need to fix it (preferrably in the same way that a
> >later kernel fixes it).
> >
>
> We precisely use this mechanism - we use
> /lib/modules/<version>/build/include/linux/config.h to figure such features
> out but when the "build" part of the path doesn't point to the right source
> tree, where do you look?. SuSE ships kernel sources "unconfigured" which
> means that you have to rely on something else to tell you what the exact
> kernel configuration looks like.

Using include/linux/config.h only tells you which kernel config options
are set/unset. That doesn't tell you anything about API changes between
kernel versions, vendor backports of some of those features, etc.

For example, one vendor ships their 2.4 kernel with the .direct_IO
address_space_operation with "struct file *" as the second parameter,
while most other kernels pass "struct inode *" as that same parameter.
Ideally, when they made that API change they should have #defined
HAVE_DIO_FILE or something in the fs.h header so it can be detected.
Instead we have configure tests to know which struct is being passed.

There are similar changes in kernel-internal APIs between versions,
structs (kiobuf is lots of fun), architectures, etc. What my point was
is that just looking at CONFIG_POSIX_ACL or whatever isn't necessarily
going to tell you the whole story, and even if some change was made in
kernel 2.6.6 doesn't mean that other vendor kernels at 2.6.5 won't also
have that.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://members.shaw.ca/adilger/ http://members.shaw.ca/golinux/

Attachment: pgp00000.pgp
Description: PGP signature