From da08199c57cedb3dc922ed6bec07932cd2aefabd Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Mon, 31 May 2010 22:43:52 +0000 Subject: nfs3: Funge . and .. ino/gen in readdir of root In the readdir reply for the root of the export, replace the ino and gen number for the . and .. entries with 1 and 0 respectively. On clients which inspect this field, the client will error out due to the change in inode number of the root directory when see for "." .. also needs to be replaced because we do not have a concept of the parent directory of root. The return of 1 and 0 is the same as the behaviour of: stat /.. command. Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 942 (NFS crashes as a vmware ESX data store) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=942 --- xlators/nfs/server/src/nfs3-helpers.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xlators/nfs/server/src/nfs3-helpers.h') diff --git a/xlators/nfs/server/src/nfs3-helpers.h b/xlators/nfs/server/src/nfs3-helpers.h index 26bc11f6c..db76b5cce 100644 --- a/xlators/nfs/server/src/nfs3-helpers.h +++ b/xlators/nfs/server/src/nfs3-helpers.h @@ -111,9 +111,9 @@ extern void nfs3_prep_readdir3args (readdir3args *ra, struct nfs3_fh *fh); extern void -nfs3_fill_readdir3res (readdir3res *res, nfsstat3 stat, uint64_t cverf, - struct iatt *dirstat, gf_dirent_t *entries,count3 count, - int is_eof, uint16_t xlid); +nfs3_fill_readdir3res (readdir3res *res, nfsstat3 stat, struct nfs3_fh *dfh, + uint64_t cverf, struct iatt *dirstat, + gf_dirent_t *entries, count3 count, int is_eof); extern void nfs3_prep_readdirp3args (readdirp3args *ra, struct nfs3_fh *fh); @@ -339,4 +339,7 @@ nfs3_verify_dircookie (struct nfs3_state *nfs3, fd_t *dirfd, cookie3 cookie, extern int nfs3_fdcache_remove (struct nfs3_state *nfs3, fd_t *fd); + +extern int +nfs3_is_parentdir_entry (char *entry); #endif -- cgit