Skip to contentSkip to conversation

don't encode parent in nfs filehandles unless nessecary

PATCH In review Christoph Hellwig 1 participant 2 messages Jan 3, 2008 – Feb 22, 2008 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't encode parent in nfs filehandles unless nessecary

As Dave pointed out after the export ops changes we now always encode the parent into the filehandle for regular files, but it's not actually needed when the filesystem is export with no_subtree_check. This one-liner fixes xfs_fs_encode_fh to skip encoding the parent unless nessecary.

fs/xfs/linux-2.6/xfs_export.c +1 -1
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_export.c
===================================================================
@@ -66,7 +66,7 @@ xfs_fs_encode_fh(
 	int			len;
 
 	/* Directories don't need their parent encoded, they have ".." */
-	if (S_ISDIR(inode->i_mode))
+	if (S_ISDIR(inode->i_mode) || !connectable)
 		fileid_type = FILEID_INO32_GEN;
 	else
 		fileid_type = FILEID_INO32_GEN_PARENT;
#1 lore raw
Quoted 5 lines · Christoph Hellwig

As Dave pointed out after the export ops changes we now always encode the parent into the filehandle for regular files, but it's not actually needed when the filesystem is export with no_subtree_check. This one-liner fixes xfs_fs_encode_fh to skip encoding the parent unless nessecary.

ping?

Quoted 9 lines

Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_export.c
===================================================================

fs/xfs/linux-2.6/xfs_export.c xfs_fs_encode_fh( · line 72

Quoted 8 lines
fs/xfs/linux-2.6/xfs_export.c +1 -1
@@ -66,7 +66,7 @@ xfs_fs_encode_fh(
 	int			len;
 
 	/* Directories don't need their parent encoded, they have ".." */
-	if (S_ISDIR(inode->i_mode))
+	if (S_ISDIR(inode->i_mode) || !connectable)
 		fileid_type = FILEID_INO32_GEN;
 	else
 		fileid_type = FILEID_INO32_GEN_PARENT;

---end quoted text---