summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@mykernel.net>2020-05-22 12:40:34 +0800
committerJan Kara <jack@suse.cz>2020-05-22 14:34:07 +0200
commit8939a3af5c08daca7914c53d9f99c222569b6509 (patch)
treefe7638f6875975ebf7f173c177040b32e167c21f
parent18bf34080c4c3beb6699181986cc97dd712498fe (diff)
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 <cgxu519@mykernel.net> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/ext2/namei.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index ccfbbf59e2fc..1a5421a34ef7 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);
}