Skip to content

Commit f8011d9

Browse files
jankaratytso
authored andcommitted
ext4: add EXT4_JOURNAL_DATA_FL and EXT4_EXTENTS_FL to modifiable mask
Add EXT4_JOURNAL_DATA_FL and EXT4_EXTENTS_FL to EXT4_FL_USER_MODIFIABLE to recognize that they are modifiable by userspace. So far we got away without having them there because ext4_ioctl_setflags() treats them in a special way. But it was really confusing like that. Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 9060dd2 commit f8011d9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

fs/ext4/ext4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ struct flex_groups {
397397
#define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */
398398

399399
#define EXT4_FL_USER_VISIBLE 0x304BDFFF /* User visible flags */
400-
#define EXT4_FL_USER_MODIFIABLE 0x204380FF /* User modifiable flags */
400+
#define EXT4_FL_USER_MODIFIABLE 0x204BC0FF /* User modifiable flags */
401401

402402
#define EXT4_FL_XFLAG_VISIBLE (EXT4_SYNC_FL | \
403403
EXT4_IMMUTABLE_FL | \

fs/ext4/ioctl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ static int ext4_ioctl_setflags(struct inode *inode,
268268
for (i = 0, mask = 1; i < 32; i++, mask <<= 1) {
269269
if (!(mask & EXT4_FL_USER_MODIFIABLE))
270270
continue;
271+
/* These flags get special treatment later */
272+
if (mask == EXT4_JOURNAL_DATA_FL || mask == EXT4_EXTENTS_FL)
273+
continue;
271274
if (mask & flags)
272275
ext4_set_inode_flag(inode, i);
273276
else

0 commit comments

Comments
 (0)