[lkml]   [2012]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH] ext2: Don't export ext2_mask_flags() to user space
    Using the exported linux/ext2_fs.h header from user space is broken
    since commit 0583fcc because the umode_t type is no longer exported.
    This happens for example when compiling busybox' tune2fs applet. The
    e2fsprogs package does not have this problem because it ships with
    its own header and doesn't use the one exported by the Linux kernel.

    However, since busybox doesn't use the ext2_mask_flags() function the
    easiest fix is to just not export it and as a result the umode_t type
    definition is longer needed.

    Signed-off-by: Thierry Reding <>
    Cc: Al Viro <>
    Cc: Jan Kara <>
    include/linux/ext2_fs.h | 6 ++----
    1 file changed, 2 insertions(+), 4 deletions(-)

    diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
    index 091ab48..20f8f33 100644
    --- a/include/linux/ext2_fs.h
    +++ b/include/linux/ext2_fs.h
    @@ -209,10 +209,7 @@ struct ext2_group_desc

    /* Mask out flags that are inappropriate for the given type of inode. */
    -#ifndef __KERNEL__
    -typedef unsigned short umode_t;
    +#ifdef __KERNEL__
    static inline __u32 ext2_mask_flags(umode_t mode, __u32 flags)
    if (S_ISDIR(mode))
    @@ -222,6 +219,7 @@ static inline __u32 ext2_mask_flags(umode_t mode, __u32 flags)
    return flags & EXT2_OTHER_FLMASK;

    * ioctl commands

     \ /
      Last update: 2012-03-21 22:53    [W:0.020 / U:12.984 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site