login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
June
»
11
Re: [PATCH 6/6] ext4: tighten restrictions on inode flags
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Aneesh Kumar K.V
Subject:
Re: [PATCH 6/6] ext4: tighten restrictions on inode flags
Date: Wednesday, June 11, 2008 - 4:31 am
On Wed, Jun 11, 2008 at 01:04:09AM +0100, Duane Griffin wrote:
quoted text
> At the moment there are few restrictions on which flags may be set on which > inodes. Specifically DIRSYNC may only be set on directories and IMMUTABLE > and APPEND may not be set on links. Tighten that to disallow TOPDIR being > set on non-directories and SECRM, UNRM, COMPR, SYNC, DIRTY, COMPRBLK, > NOCOMPR, ECOMPR, INDEX, JOURNAL_DATA, NOTAIL, HUGE_FILE, EXTENTS or > EXT_MIGRATE being set on anything but regular files or directories. > > Introduce a flags masking function which masks flags based on mode and use > it during inode creation and when flags are set via the ioctl to facilitate > future consistency. > > Signed-off-by: Duane Griffin <duaneg@dghda.com> > -- > > The specific flags masked out here are those suggested by Andreas, as well > as IMMUTABLE, which I included to match the behaviour of the existing code, > and EXT_MIGRATE. > > It would be good to get some review of these. > > --- > fs/ext4/ext4.h | 24 ++++++++++++++++++++++++ > fs/ext4/ialloc.c | 14 +++++--------- > fs/ext4/ioctl.c | 3 +-- > 3 files changed, 30 insertions(+), 11 deletions(-) > > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h > index 1a4faa5..2aafd1b 100644 > --- a/fs/ext4/ext4.h > +++ b/fs/ext4/ext4.h > @@ -243,6 +243,30 @@ struct ext4_group_desc > EXT4_JOURNAL_DATA_FL | EXT4_NOTAIL_FL|\ > EXT4_DIRSYNC_FL) > > +/* Flags that are inappropriate for regular files. */ > +#define EXT4_REG_FLMASK (EXT4_DIRSYNC_FL | EXT4_TOPDIR_FL) > + > +/* Flags that are inappropriate for non-directories/regular files. */ > +#define EXT4_OTHER_FLMASK (EXT4_SECRM_FL | EXT4_UNRM_FL | EXT4_COMPR_FL |\ > + EXT4_SYNC_FL | EXT4_IMMUTABLE_FL | EXT4_APPEND_FL |\ > + EXT4_DIRTY_FL | EXT4_COMPRBLK_FL | EXT4_NOCOMPR_FL|\ > + EXT4_ECOMPR_FL | EXT4_INDEX_FL |\ > + EXT4_JOURNAL_DATA_FL | EXT4_NOTAIL_FL |\ > + EXT4_DIRSYNC_FL | EXT4_TOPDIR_FL |\ > + EXT4_HUGE_FILE_FL | EXT4_EXTENTS_FL |\ > + EXT4_EXT_MIGRATE) > + > +/* Mask out flags that are inappropriate for the given type of inode. */ > +static inline __le32 ext4_mask_flags(__le16 mode, __le32 flags) > +{ > + if (S_ISDIR(mode)) > + return flags; > + else if (S_ISREG(mode)) > + return flags & ~EXT4_REG_FLMASK; > + else > + return flags & ~EXT4_OTHER_FLMASK; > +} > +
why are the arguments __le32 ? They should be in host order. static inline __u32 ext4_mask_flags(umode_t mode, __u32 flags) -aneesh --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/6][v2] ext{2,3,4}: tighten inheritance and settin ...
, Duane Griffin
, (Tue Jun 10, 5:04 pm)
[PATCH 1/6] ext2: don't inherit inappropriate inode flags ...
, Duane Griffin
, (Tue Jun 10, 5:04 pm)
[PATCH 2/6] ext3: don't inherit inappropriate inode flags ...
, Duane Griffin
, (Tue Jun 10, 5:04 pm)
[PATCH 3/6] ext4: don't inherit inappropriate inode flags ...
, Duane Griffin
, (Tue Jun 10, 5:04 pm)
[PATCH 4/6] ext2: tighten restrictions on inode flags
, Duane Griffin
, (Tue Jun 10, 5:04 pm)
[PATCH 5/6] ext3: tighten restrictions on inode flags
, Duane Griffin
, (Tue Jun 10, 5:04 pm)
[PATCH 6/6] ext4: tighten restrictions on inode flags
, Duane Griffin
, (Tue Jun 10, 5:04 pm)
Re: [PATCH 6/6] ext4: tighten restrictions on inode flags
, Aneesh Kumar K.V
, (Wed Jun 11, 4:31 am)
Re: [PATCH 6/6] ext4: tighten restrictions on inode flags
, Duane Griffin
, (Wed Jun 11, 4:49 am)
Re: [PATCH 4/6] ext2: tighten restrictions on inode flags
, Andreas Dilger
, (Thu Jun 12, 2:06 am)
Re: [PATCH 4/6] ext2: tighten restrictions on inode flags
, Duane Griffin
, (Thu Jun 12, 2:38 am)
Re: [PATCH 6/6] ext4: tighten restrictions on inode flags
, Dave Kleikamp
, (Thu Jun 12, 12:27 pm)
Re: [PATCH 6/6] ext4: tighten restrictions on inode flags
, Duane Griffin
, (Thu Jun 12, 1:35 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Fortier,Vincent [Montreal]
2.6.21.5 june 30th to july 1st date hang?
Jeff Dike
[ PATCH 2/6 ] UML - Formatting fixes around os_{read_write}_file callers
Liam Girdwood
[PATCH 07/13] regulator: regulator test harness
Oleg Nesterov
Re: Getting the new RxRPC patches upstream
Stefan Seyfried
Re: 2.6.19-rc5: grub is much slower resuming from suspend-to-disk than in 2.6.18
linux-netdev
:
Arnaud Ebalard
Re: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0
Jan Engelhardt
Re: [PATCH iptables] extension: add xt_cpu match
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Sebastian Andrzej Siewior
[PATCH 8/8] net/emergency: remove locking from reycling pool if emergncy pools are...
David Miller
Re: [PATCH] qlcnic: dont assume NET_IP_ALIGN is 2
git
:
Jakub Narebski
Re: git on MacOSX and files with decomposed utf-8 file names
Brandon Casey
Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the def...
Christian Couder
[PATCH 1/3] rev-parse: add test script for "--verify"
Ramkumar Ramachandra
Re: [GSoC update] git-remote-svn: The final one
Junio C Hamano
Re: git-rm isn't the inverse action of git-add
openbsd-misc
:
Joachim Schipper
Re: UVC Webcams
Florin Andrei
SOLVED [was: firewall is very slow, something's wrong]
Todd Alan Smith
Re: Microsoft gets the Most Secure Operating Systems award
Neal Hogan
Re: Need Advice: Thinkpad T60 or T61?
Sam Fourman Jr.
Re: Real men don't attack straw men
git-commits-head
:
Linux Kernel Mailing List
ACPI: Disable ARB_DISABLE on platforms where it is not needed
Linux Kernel Mailing List
m68knommu: add read_barrier_depends() and irqs_disabled_flags()
Linux Kernel Mailing List
[MTD] Add mtd panic_write function pointer
Linux Kernel Mailing List
[ARM] pxa: remove duplicate select statements from Kconfig
Linux Kernel Mailing List
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
Colocation donated by:
Syndicate