From: zoulasc Date: Fri, 22 Jan 2016 15:18:52 +0000 (-0500) Subject: The NFSv3 readdir method is expected to return the attributes of the X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=cfca7ea1fbb548d1fa28e9e14c8aa1c82bee11ca;p=am-utils-6.2.git The NFSv3 readdir method is expected to return the attributes of the directory being read for both the success and failure cases. (Ian Kent) --- diff --git a/amd/nfs_subr.c b/amd/nfs_subr.c index 6a1b717d..00a1dc01 100644 --- a/amd/nfs_subr.c +++ b/amd/nfs_subr.c @@ -1627,28 +1627,29 @@ am_nfs3_readdir_3_svc(am_READDIR3args *argp, struct svc_req *rqstp) result.status = nfs_error(retry); } else { am_dirlist3 *list = &result.res_u.ok.reply; + nfsfattr *fattr; + am_fattr3 *fattr3; am_nfsstat3 status; if (amuDebug(D_TRACE)) plog(XLOG_DEBUG, "\treaddir_3(%s)", mp->am_path); + fattr = &mp->am_fattr; + status = mp->am_al->al_mnt->mf_ops->readdir(mp, (voidp)&cookie, list, entries, count); if (status == 0) { post_op_dir = &result.res_u.ok.dir_attributes; - nfsfattr *fattr; - am_fattr3 *fattr3; - - fattr = &mp->am_fattr; - fattr3 = &post_op_dir->am_post_op_attr_u.attributes; post_op_dir->attributes_follow = 1; - fattr_to_fattr3(fattr, fattr3); + fattr3 = &post_op_dir->am_post_op_attr_u.attributes; result.status = AM_NFS3_OK; } else { post_op_dir = &result.res_u.fail.dir_attributes; - post_op_dir->attributes_follow = 0; + post_op_dir->attributes_follow = 1; + fattr3 = &post_op_dir->am_post_op_attr_u.attributes; result.status = nfs_error(status); } + fattr_to_fattr3(fattr, fattr3); mp->am_stats.s_readdir++; }