Skip to contentSkip to conversation

ext2: include fs.h in ext2_fs.h

PATCH In review Eric Sandeen 2 participants 2 messages Dec 3, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext2: include fs.h in ext2_fs.h

As reported by Cezary Sliwa in
https://bugzilla.kernel.org/show_bug.cgi?id=24282
ext2_fs.h references FS_DIRSYNC_FL etc, but does not include <linux/fs.h> to define them. This seems ok for kernelspace builds, but breaks userspace applications which include ext2_fs.h.

---

include/linux/ext2_fs.h +1 -0
index 2dfa707..91f90e4 100644
@@ -16,6 +16,7 @@
 #ifndef _LINUX_EXT2_FS_H
 #define _LINUX_EXT2_FS_H
 
+#include <linux/fs.h>
 #include <linux/types.h>
 #include <linux/magic.h>
#1 lore raw
Quoted 9 lines · Eric Sandeen

As reported by Cezary Sliwa in
https://bugzilla.kernel.org/show_bug.cgi?id=24282
ext2_fs.h references FS_DIRSYNC_FL etc, but does not include <linux/fs.h> to define them. This seems ok for kernelspace builds, but breaks userspace applications which include ext2_fs.h.

I wonder if we would be better off getting application programs weaned off of trying to use the kernel's version of ext2_fs.h altogether. E2fsprogs ships one which is going to be more uptodate, and works for ext2/ext3/ext4. Certainly if you plan to be using libext2fs (which I would strongly advise for any program hoping to manipulate ext2 filesystem structures directly), you should be using the header file shipped with e2fsprogs.

Debian and Ubuntu for example ships /usr/include/ext2fs/ext2_fs.h as part of its e2fslibs-dev package.

- Ted