From 9dbc4764bcabf718053bb320c28bcb8d794f2fa3 Mon Sep 17 00:00:00 2001 From: johann Date: Wed, 1 Jul 2009 11:58:56 +0000 Subject: [PATCH] Branch b_release_1_8_1 b=19559 i=shadow (patch from Oleg) i=panda Fix NFS export: properly calculate fh size & reintroduce ll_get_parent. --- lustre/ChangeLog | 6 ++++++ lustre/llite/llite_nfs.c | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 0fe125b..42a69e4 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -179,6 +179,12 @@ Description: Client locked up when running multiple instances of an app. on Details : ll_shrink_cache() can sleep while holding the ll_sb_lock. Convert ll_sb_lock to a read/write semaphore to fix the problem. +Severity : normal +Bugzilla : 19559 +Description: Cannot acces an NFS-mounted Lustre filesystem +Details : An NFS client cannot access the Lustre filesystem NFS-mounted + from a Lustre-client exporting the Lustre filesystem via NFS. + ------------------------------------------------------------------------------- tbd Sun Microsystems, Inc. diff --git a/lustre/llite/llite_nfs.c b/lustre/llite/llite_nfs.c index 002e95e..c4c1f15 100644 --- a/lustre/llite/llite_nfs.c +++ b/lustre/llite/llite_nfs.c @@ -150,7 +150,8 @@ struct lustre_nfs_fid { umode_t mode; }; -/* The return value is file handle type: +/* plen is in 32 bit units! + * The return value is file handle type: * 1 -- contains child file handle; * 2 -- contains child file handle and parent file handle; * 255 -- error. @@ -164,17 +165,17 @@ static int ll_encode_fh(struct dentry *de, __u32 *fh, int *plen, ENTRY; CDEBUG(D_INFO, "encoding for (%lu) maxlen=%d minlen=%u\n", - inode->i_ino, *plen, + inode->i_ino, *plen*4, (int)sizeof(struct lustre_nfs_fid)); - if (*plen < sizeof(struct lustre_nfs_fid)) + if (*plen*4 < sizeof(struct lustre_nfs_fid)) RETURN(255); ll_inode2fid(&nfs_fid->child, inode); ll_inode2fid(&nfs_fid->parent, parent); nfs_fid->mode = (S_IFMT & inode->i_mode); - *plen = sizeof(struct lustre_nfs_fid); + *plen = sizeof(struct lustre_nfs_fid)/4; RETURN(LUSTRE_NFS_FID); } @@ -282,6 +283,7 @@ struct dentry *ll_get_parent(struct dentry *dchild) struct export_operations lustre_export_operations = { .encode_fh = ll_encode_fh, + .get_parent = ll_get_parent, #ifdef HAVE_FH_TO_DENTRY .fh_to_dentry = ll_fh_to_dentry, .fh_to_parent = ll_fh_to_parent, -- 1.8.3.1