aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-08-31 11:54:51 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-11 12:36:32 -0500
commitd24f405b711a4247f31358339dc1112ca659e6fe (patch)
tree4cea1a63deebfd31be589d98d6c594b15ff156e8
parentb97cdd64caeac76928c0bac6a844743fa2431200 (diff)
ext2,ext3,ext4: don't inherit APPEND_FL or IMMUTABLE_FL for new inodes
commit 1cd9f0976aa4606db8d6e3dc3edd0aca8019372a upstream. This doesn't make much sense, and it exposes a bug in the kernel where attempts to create a new file in an append-only directory using O_CREAT will fail (but still leave a zero-length file). This was discovered when xfstests #79 was generalized so it could run on all file systems. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/ext4/ext4.h3
-rw-r--r--include/linux/ext2_fs.h4
-rw-r--r--include/linux/ext3_fs.h4
3 files changed, 5 insertions, 6 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 354619a1aed..4bc683806ea 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -357,8 +357,7 @@ struct flex_groups {
357 357
358/* Flags that should be inherited by new inodes from their parent. */ 358/* Flags that should be inherited by new inodes from their parent. */
359#define EXT4_FL_INHERITED (EXT4_SECRM_FL | EXT4_UNRM_FL | EXT4_COMPR_FL |\ 359#define EXT4_FL_INHERITED (EXT4_SECRM_FL | EXT4_UNRM_FL | EXT4_COMPR_FL |\
360 EXT4_SYNC_FL | EXT4_IMMUTABLE_FL | EXT4_APPEND_FL |\ 360 EXT4_SYNC_FL | EXT4_NODUMP_FL | EXT4_NOATIME_FL |\
361 EXT4_NODUMP_FL | EXT4_NOATIME_FL |\
362 EXT4_NOCOMPR_FL | EXT4_JOURNAL_DATA_FL |\ 361 EXT4_NOCOMPR_FL | EXT4_JOURNAL_DATA_FL |\
363 EXT4_NOTAIL_FL | EXT4_DIRSYNC_FL) 362 EXT4_NOTAIL_FL | EXT4_DIRSYNC_FL)
364 363
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 2dfa7076e8b..0bfcb76bf95 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -196,8 +196,8 @@ struct ext2_group_desc
196 196
197/* Flags that should be inherited by new inodes from their parent. */ 197/* Flags that should be inherited by new inodes from their parent. */
198#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ 198#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\
199 EXT2_SYNC_FL | EXT2_IMMUTABLE_FL | EXT2_APPEND_FL |\ 199 EXT2_SYNC_FL | EXT2_NODUMP_FL |\
200 EXT2_NODUMP_FL | EXT2_NOATIME_FL | EXT2_COMPRBLK_FL|\ 200 EXT2_NOATIME_FL | EXT2_COMPRBLK_FL |\
201 EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\ 201 EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\
202 EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL) 202 EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL)
203 203
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 5e06acf95d0..7b14d251c78 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -180,8 +180,8 @@ struct ext3_group_desc
180 180
181/* Flags that should be inherited by new inodes from their parent. */ 181/* Flags that should be inherited by new inodes from their parent. */
182#define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\ 182#define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\
183 EXT3_SYNC_FL | EXT3_IMMUTABLE_FL | EXT3_APPEND_FL |\ 183 EXT3_SYNC_FL | EXT3_NODUMP_FL |\
184 EXT3_NODUMP_FL | EXT3_NOATIME_FL | EXT3_COMPRBLK_FL|\ 184 EXT3_NOATIME_FL | EXT3_COMPRBLK_FL |\
185 EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\ 185 EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\
186 EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL) 186 EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL)
187 187