Skip to contentSkip to conversation

fat: make sure to set d_ops in fat_get_parent

PATCH In review Christoph Hellwig 2 participants 2 messages Nov 11, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fat: make sure to set d_ops in fat_get_parent

fat_get_parent needs to setup the dentry operations, otherwise we might lose them when the NFS server needs to reconnect out of cache inodes.

fs/fat/inode.c +2 -0
Index: linux-2.6/fs/fat/inode.c
===================================================================
@@ -749,6 +749,8 @@ static struct dentry *fat_get_parent(str
 	brelse(bh);
 
 	parent = d_obtain_alias(inode);
+	if (!IS_ERR(parent))
+		parent->d_op = sb->s_root->d_op;
 out:
 	unlock_super(sb);
 
maintainer
#1 lore raw
Quoted 11 lines · Christoph Hellwig

fat_get_parent needs to setup the dentry operations, otherwise we might lose them when the NFS server needs to reconnect out of cache inodes.

Index: linux-2.6/fs/fat/inode.c
===================================================================

fs/fat/inode.c static struct dentry *fat_get_parent(str · line 755

Quoted 7 lines
fs/fat/inode.c +2 -0
@@ -749,6 +749,8 @@ static struct dentry *fat_get_parent(str
 	brelse(bh);
 
 	parent = d_obtain_alias(inode);
+	if (!IS_ERR(parent))
+		parent->d_op = sb->s_root->d_op;
 out:
 	unlock_super(sb);

Looks good. Thanks.

Signature · 1 line
OGAWA Hirofumi <[email protected]>