aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/inode.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2011-01-19 12:09:53 -0500
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2011-03-08 00:58:29 -0500
commitb253a3e4f2b8eed69b804952ef926df0ac788595 (patch)
treefc111c5401f15cd5421fc73372d3f4589716af4f /fs/nilfs2/inode.c
parent32f4aeb31583a85c1e9a5d6d485055c090cebbfb (diff)
nilfs2: tighten restrictions on inode flags
Nilfs has few rectrictions on which flags may be set on which inodes like ext2/3/4 filesystems used to be. 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. This introduces a flags masking function like those of extN and uses it during inode creation. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/inode.c')
-rw-r--r--fs/nilfs2/inode.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index 2e6ac8e9203a..2534af8d2b5c 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -315,11 +315,8 @@ struct inode *nilfs_new_inode(struct inode *dir, int mode)
315 /* No lock is needed; iget() ensures it. */ 315 /* No lock is needed; iget() ensures it. */
316 } 316 }
317 317
318 ii->i_flags = NILFS_I(dir)->i_flags; 318 ii->i_flags = nilfs_mask_flags(
319 if (S_ISLNK(mode)) 319 mode, NILFS_I(dir)->i_flags & NILFS_FL_INHERITED);
320 ii->i_flags &= ~(FS_IMMUTABLE_FL | FS_APPEND_FL);
321 if (!S_ISDIR(mode))
322 ii->i_flags &= ~FS_DIRSYNC_FL;
323 320
324 /* ii->i_file_acl = 0; */ 321 /* ii->i_file_acl = 0; */
325 /* ii->i_dir_acl = 0; */ 322 /* ii->i_dir_acl = 0; */