diff options
author | Jiffin Tony Thottan <jthottan@gmail.com> | 2015-12-14 15:29:21 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2015-12-17 06:33:59 -0800 |
commit | e9bb9f018f14f7d32c2ff4cc33df3a114a6f376b (patch) | |
tree | 9b1ca715e878486e60ad6f1ef3a6c82599597426 | |
parent | 12f36283d9e18246a97ac6a397cc54dc46ff89c5 (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.
Cherry picked from commit 5e36564754e2d83a7666066f4da7f148960a5694:
> 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>
Change-Id: Ida82b6d1636f796abacf0b8f83f8b24037baec3b
BUG: 1291208
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: http://review.gluster.org/12989
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
-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 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; |