From 8939a3af5c08daca7914c53d9f99c222569b6509 Mon Sep 17 00:00:00 2001 From: Chengguang Xu Date: Fri, 22 May 2020 12:40:34 +0800 Subject: [PATCH] ext2: Fix i_op setting for special inode Let's always set special inode i_op to &ext2_special_inode_operations regardless of CONFIG_EXT2_FS_XATTR setting. It makes sence to be able to query extended inode flags (needing ->setattr and ->getattr callbacks) even when CONFIG_EXT2_FS_XATTR is not set. Link: https://lore.kernel.org/r/20200522044035.24190-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Signed-off-by: Jan Kara --- fs/ext2/namei.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index ccfbbf5..1a5421a 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -136,9 +136,7 @@ static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode, err = PTR_ERR(inode); if (!IS_ERR(inode)) { init_special_inode(inode, inode->i_mode, rdev); -#ifdef CONFIG_EXT2_FS_XATTR inode->i_op = &ext2_special_inode_operations; -#endif mark_inode_dirty(inode); err = ext2_add_nondir(dentry, inode); } -- 2.7.4