1 ext4: add EXT4_JOURNAL_DATA_FL and EXT4_EXTENTS_FL to modifiable mask
3 From: Jan Kara <jack@suse.cz>
5 Add EXT4_JOURNAL_DATA_FL and EXT4_EXTENTS_FL to EXT4_FL_USER_MODIFIABLE
6 to recognize that they are modifiable by userspace. So far we got away
7 without having them there because ext4_ioctl_setflags() treats them in a
8 special way. But it was really confusing like that.
10 Signed-off-by: Jan Kara <jack@suse.cz>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 fs/ext4/ioctl.c | 3 +++
15 2 files changed, 4 insertions(+), 1 deletion(-)
17 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
18 index ea31931386ec..0814c9570bf1 100644
21 @@ -393,7 +393,7 @@ struct flex_groups {
22 #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */
24 #define EXT4_FL_USER_VISIBLE 0x304BDFFF /* User visible flags */
25 -#define EXT4_FL_USER_MODIFIABLE 0x204380FF /* User modifiable flags */
26 +#define EXT4_FL_USER_MODIFIABLE 0x204BC0FF /* User modifiable flags */
28 #define EXT4_FL_XFLAG_VISIBLE (EXT4_SYNC_FL | \
30 diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
31 index 1bb7df5e4536..e9433c155454 100644
34 @@ -267,6 +267,9 @@ static int ext4_ioctl_setflags(struct inode *inode,
35 for (i = 0, mask = 1; i < 32; i++, mask <<= 1) {
36 if (!(mask & EXT4_FL_USER_MODIFIABLE))
38 + /* These flags get special treatment later */
39 + if (mask == EXT4_JOURNAL_DATA_FL || mask == EXT4_EXTENTS_FL)
42 ext4_set_inode_flag(inode, i);