ext4: tighten restrictions on inode flags
commit31e8c0f55ae1a41eb8e7a92b6ec39ae445045230
authorDuane Griffin <duaneg@dghda.com>
Tue, 2 Jun 2009 12:07:43 +0000 (2 08:07 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jun 2009 16:40:22 +0000 (15 09:40 -0700)
treeea2e81517764f2b83cc4519be5dcbc88825fe81d
parentb1afbf95c28f22ca2c52a8535a42717b0f8eff30
ext4: tighten restrictions on inode flags

(cherry picked from commit 2dc6b0d48ca0599837df21b14bb8393d0804af57)

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 only NODUMP and NOATIME to be set
on non-regular file, non-directories.

Introduces 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>
Acked-by: Andreas Dilger <adilger@sun.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/ext4.h
fs/ext4/ialloc.c
fs/ext4/ioctl.c