All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: linux-kernel@vger.kernel.org
Cc: Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	linux-ext4@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH] ext2: Don't export ext2_mask_flags() to user space
Date: Wed, 21 Mar 2012 22:50:07 +0100	[thread overview]
Message-ID: <1332366608-2695-1-git-send-email-thierry.reding@avionic-design.de> (raw)

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 <thierry.reding@avionic-design.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
Cc: stable@vger.kernel.org
---
 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
 #define EXT2_OTHER_FLMASK (EXT2_NODUMP_FL | EXT2_NOATIME_FL)
 
 /* Mask out flags that are inappropriate for the given type of inode. */
-#ifndef __KERNEL__
-typedef unsigned short umode_t;
-#endif
-
+#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)
 	else
 		return flags & EXT2_OTHER_FLMASK;
 }
+#endif
 
 /*
  * ioctl commands
-- 
1.7.9.4


             reply	other threads:[~2012-03-21 21:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21 21:50 Thierry Reding [this message]
2012-03-21 22:23 ` [PATCH] ext2: Don't export ext2_mask_flags() to user space Jan Kara
2012-03-21 23:16   ` Ted Ts'o
2012-03-22  5:53     ` Thierry Reding
2012-03-22  6:00       ` Artem Bityutskiy
2012-03-22 16:28         ` Ted Ts'o
2012-03-22 16:47           ` Thierry Reding
2012-03-22 18:31             ` Ted Ts'o
2012-03-23  9:27               ` [PATCH] ext2: No longer export ext2_fs.h " Thierry Reding
2012-03-23  9:27                 ` Thierry Reding
2012-03-23 13:13                 ` Ted Ts'o
2012-03-23 17:55                   ` Al Viro
2012-03-24 21:51                     ` Ted Ts'o
2012-03-24 22:16                       ` H. Peter Anvin
2012-03-25  1:16                         ` Ted Ts'o
2012-03-22 17:31           ` [PATCH] ext2: Don't export ext2_mask_flags() " Al Viro
2012-03-23  0:25             ` Andreas Dilger
2012-03-24  6:51               ` Mike Frysinger
2012-03-24  6:50             ` Mike Frysinger
2012-03-24  6:50               ` Mike Frysinger
2012-03-24  8:37               ` Al Viro
2012-03-24 17:59                 ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1332366608-2695-1-git-send-email-thierry.reding@avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.