Skip to contentSkip to conversation

ext4: ext4_mknod: always set i_op

PATCH Applied Bernd Schubert 2 participants 2 messages Sep 5, 2012 – Sep 27, 2012 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: ext4_mknod: always set i_op

While I was looking through the code, I noticed i_op is not always initialized, although operations such as setattr probably always should be set.

ext4: ext4_mknod: always set i_op

From: Bernd Schubert <[email protected]>

ext4_special_inode_operations have their own ifdef CONFIG_EXT4_FS_XATTR to mask those methods. And ext4_iget also always sets it, so there is an inconsistency.

---
 fs/ext4/namei.c |    2 --
 1 file changed, 2 deletions(-)
fs/ext4/namei.c +0 -2
index 2a42cc0..d13873d 100644
@@ -2149,9 +2149,7 @@ retry:
 	err = PTR_ERR(inode);
 	if (!IS_ERR(inode)) {
 		init_special_inode(inode, inode->i_mode, rdev);
-#ifdef CONFIG_EXT4_FS_XATTR
 		inode->i_op = &ext4_special_inode_operations;
-#endif
 		err = ext4_add_nondir(handle, dentry, inode);
 	}
 	ext4_journal_stop(handle);
maintainer Applied
#1 lore raw
Quoted 7 lines · Bernd Schubert

While I was looking through the code, I noticed i_op is not always initialized, although operations such as setattr probably always should be set.

ext4: ext4_mknod: always set i_op

Quoted 7 lines

From: Bernd Schubert <[email protected]>

ext4_special_inode_operations have their own ifdef CONFIG_EXT4_FS_XATTR to mask those methods. And ext4_iget also always sets it, so there is an inconsistency.

Applied, thanks!!

- Ted