Skip to content

Commit

Permalink
ext2: Set superblock revision when enabling xattr feature
Browse files Browse the repository at this point in the history
When setting the first xattr, we automatically enable
EXT2_FEATURE_COMPAT_EXT_ATTR. However we forget to call
ext2_update_dynamic_rev() so in theory if the filesystem was created as
ancient one without features support, this could be missed. The
consequences are minor anyway - since the feature is compat one, only
old e2fsck which does not understand xattrs could do something bad.

Reported-by: Andreas Dilger <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
jankara committed Jan 22, 2019
1 parent f6f5014 commit 032cdc3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ext2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ static void ext2_xattr_update_super_block(struct super_block *sb)
return;

spin_lock(&EXT2_SB(sb)->s_lock);
ext2_update_dynamic_rev(sb);
EXT2_SET_COMPAT_FEATURE(sb, EXT2_FEATURE_COMPAT_EXT_ATTR);
spin_unlock(&EXT2_SB(sb)->s_lock);
mark_buffer_dirty(EXT2_SB(sb)->s_sbh);
Expand Down

0 comments on commit 032cdc3

Please sign in to comment.