diff options
author | Jiffin Tony Thottan <jthottan@gmail.com> | 2015-12-14 15:29:21 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2015-12-16 09:32:32 -0800 |
commit | 5e36564754e2d83a7666066f4da7f148960a5694 (patch) | |
tree | fa1e1ed4fe1cf2bb22a609cfe94ac355765956fd /xlators/nfs/server | |
parent | f853ed9c61bf65cb39f859470a8ffe8973818868 (diff) |
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.
Change-Id: Ieb6724b05301cdbf0a0ef15ad9db51014faa0457
BUG: 1291212
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: http://review.gluster.org/12960
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: soumya k <skoduri@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/nfs/server')
-rw-r--r-- | xlators/nfs/server/src/nfs3-helpers.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c index 2c24f94f540..2203f1e1a90 100644 --- a/xlators/nfs/server/src/nfs3-helpers.c +++ b/xlators/nfs/server/src/nfs3-helpers.c @@ -777,7 +777,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; |