From e9bb9f018f14f7d32c2ff4cc33df3a114a6f376b Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Mon, 14 Dec 2015 15:29:21 +0530 Subject: nfs : Inform client to perform extra GETATTR call for 'T' files Due to the changes from http://review.gluster.org/#/c/12722/, for tier volume the readirp will be send only to cold subvol, therefore the resulting list may contain 'T' files. For those files, by performing additional getattr call will populate the attributes correctly. This check should be based on inode value passed from the readdirp(both T files and directory have NULL value) and skip directory in the same. Cherry picked from commit 5e36564754e2d83a7666066f4da7f148960a5694: > Change-Id: Ieb6724b05301cdbf0a0ef15ad9db51014faa0457 > BUG: 1291212 > Signed-off-by: Jiffin Tony Thottan > Reviewed-on: http://review.gluster.org/12960 > Tested-by: Gluster Build System > Reviewed-by: soumya k > Tested-by: NetBSD Build System > Reviewed-by: Kaleb KEITHLEY Change-Id: Ida82b6d1636f796abacf0b8f83f8b24037baec3b BUG: 1291208 Signed-off-by: Jiffin Tony Thottan Reviewed-on: http://review.gluster.org/12989 Reviewed-by: Kaleb KEITHLEY Reviewed-by: Niels de Vos Tested-by: Gluster Build System --- xlators/nfs/server/src/nfs3-helpers.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'xlators/nfs/server') diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c index ca56404f127..f2219d21003 100644 --- a/xlators/nfs/server/src/nfs3-helpers.c +++ b/xlators/nfs/server/src/nfs3-helpers.c @@ -782,7 +782,21 @@ nfs3_fill_entryp3 (gf_dirent_t *entry, struct nfs3_fh *dirfh, uint64_t devid) nfs3_fh_build_child_fh (dirfh, &entry->d_stat, &newfh); nfs3_map_deviceid_to_statdev (&entry->d_stat, devid); - ent->name_attributes = nfs3_stat_to_post_op_attr (&entry->d_stat); + /* * + * In tier volume, the readdirp send only to cold subvol + * which will populate in the 'T' file entries in the result. + * For such files an explicit stat call is required, by setting + * following argument client will perform the same. + * + * The inode value for 'T' files and directory is NULL, so just + * skip the check if it is directory. + */ + if (!(IA_ISDIR(entry->d_stat.ia_type)) && (entry->inode == NULL)) + ent->name_attributes.attributes_follow = FALSE; + else + ent->name_attributes = + nfs3_stat_to_post_op_attr (&entry->d_stat); + ent->name_handle = nfs3_fh_to_post_op_fh3 (&newfh); err: return ent; -- cgit