Bug 24282 - linux/ext2_fs.h uses defines from linux/fs.h
Summary: linux/ext2_fs.h uses defines from linux/fs.h
Status: RESOLVED INVALID
Alias: None
Product: File System
Classification: Unclassified
Component: ext2 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Eric Sandeen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-03 12:55 UTC by Cezary Sliwa
Modified: 2012-08-15 19:10 UTC (History)
4 users (show)

See Also:
Kernel Version: 2.6.33.4
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Cezary Sliwa 2010-12-03 12:55:33 UTC
An inline function from linux/ext2_fs.h does not compile without including linux/fs.h.
Comment 1 Eric Sandeen 2010-12-03 15:13:08 UTC
Please attach your config and the compile error that you get, thanks.

-Eric
Comment 2 Cezary Sliwa 2010-12-03 15:20:24 UTC
The error occured when compiling a user space program. Just include linux/ext2_fs.h whithout linux/fs.h and you get:

/usr/include/linux/ext2_fs.h: In function 'ext2_mask_flags':
/usr/include/linux/ext2_fs.h:182: error: 'FS_DIRSYNC_FL' undeclared (first use in this function)
/usr/include/linux/ext2_fs.h:182: error: (Each undeclared identifier is reported only once
/usr/include/linux/ext2_fs.h:182: error: for each function it appears in.)
/usr/include/linux/ext2_fs.h:182: error: 'FS_TOPDIR_FL' undeclared (first use in this function)
/usr/include/linux/ext2_fs.h:184: error: 'FS_NODUMP_FL' undeclared (first use in this function)
/usr/include/linux/ext2_fs.h:184: error: 'FS_NOATIME_FL' undeclared (first use in this function)
Comment 3 Eric Sandeen 2010-12-03 15:58:32 UTC
ah, userspace.  Thanks, that wasn't clear.

commit 36695673b012096228ebdc1b39a6a5850daa474e
Author: David Howells <dhowells@redhat.com>
Date:   Tue Aug 29 19:06:16 2006 +0100

    [PATCH] BLOCK: Move common FS-specific ioctls to linux/fs.h [try #6]

changed to use those FS_ flags; maybe one of the existing #includes used to pull in fs.h, not sure.
Comment 4 Eric Sandeen 2010-12-03 16:27:02 UTC
I sent a patch upstream for this.
Comment 5 Andreas Dilger 2010-12-03 20:12:34 UTC
(In reply to comment #2)
> The error occured when compiling a user space program. Just include
> linux/ext2_fs.h whithout linux/fs.h and you get:
> 
> /usr/include/linux/ext2_fs.h: In function 'ext2_mask_flags':
> /usr/include/linux/ext2_fs.h:182: error: 'FS_DIRSYNC_FL' undeclared (first
> use
> in this function)
> /usr/include/linux/ext2_fs.h:182: error: (Each undeclared identifier is
> reported only once
> /usr/include/linux/ext2_fs.h:182: error: for each function it appears in.)
> /usr/include/linux/ext2_fs.h:182: error: 'FS_TOPDIR_FL' undeclared (first use
> in this function)
> /usr/include/linux/ext2_fs.h:184: error: 'FS_NODUMP_FL' undeclared (first use
> in this function)
> /usr/include/linux/ext2_fs.h:184: error: 'FS_NOATIME_FL' undeclared (first
> use
> in this function)

Wouldn't it be better to include <ext2fs/ext2_fs.h> from e2fsprogs-devel, instead of <linux/ext2_fs.h> from the kernel?
Comment 6 Eric Sandeen 2010-12-03 20:17:03 UTC
It probably is better but if the header is provided, shouldn't it work?
Comment 7 Cezary Sliwa 2012-08-15 19:03:13 UTC
Resolved invalid? I understand this needed 20 months, but what???

This is what makes Linux such a great piece of software.
Comment 8 Alan 2012-08-15 19:10:34 UTC
The kernel headers are not meant to be directly used by applications

(which was dealt with in 2010 in Andreas comment)

I'm just cleaning up old stuff

Note You need to log in before you can comment on or make changes to this bug.