Description of problem: On NFS mount, file copy operation fails with EINVAL. i.e. the below command executed on a nfs mount fails. cp /etc/resolv.conf . cp: cannot create regular file ‘./resolv.conf’: Invalid argument. This is the error reported in the logs [2015-04-09 13:24:30.541426] W [nfs3.c:2516:nfs3svc_create_stat_cbk] 0-nfs: abd82b73: /resolv.conf => -1 (Invalid argument) [2015-04-09 13:24:30.541545] W [nfs3-helpers.c:3398:nfs3_log_common_res] 0-nfs-nfsv3: XID: abd82b73, CREATE: NFS: 22(Invalid argument for operation), POSIX: 22(Invalid argument) Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. copy a file to nfs mount 2. 3. Actual results: Expected results: Additional info: It seems that before sending the create fop, nfs server tries t resolve the path by doing a lookup on the entry that is being created. When resolve fails, the return value and the errno are saved in the local structure (frame->local). But when create_resume has to be done, it tries to do a auth status check where the op_ret and op_errno value saved in the local are changed. This is the macro where the op_ret and op_errno of resolve operation are changed. #define nfs3_check_fh_auth_status(cst, nfstat, is_write_op, erlabl) \ do { \ xlator_t *xlatorp = NULL; \ char buf[256], gfid[256]; \ rpc_transport_t *trans = NULL; \ cst->resolve_ret = cst->resolve_errno = \ nfs3_fh_auth_nfsop (cst, is_write_op); \ if ((cst)->resolve_ret < 0) { \ trans = rpcsvc_request_transport (cst->req); \ xlatorp = nfs3_fh_to_xlator (cst->nfs3state, \ &cst->resolvefh); \ gf_uuid_unparse (cst->resolvefh.gfid, gfid); \ sprintf (buf, "(%s) %s : %s", \ trans->peerinfo.identifier, \ xlatorp ? xlatorp->name : "ERR", gfid); \ gf_log (GF_NFS3, GF_LOG_ERROR, "Unable to resolve FH"\ ": %s", buf); \ nfstat = nfs3_errno_to_nfsstat3 (-cst->resolve_errno);\ goto erlabl; \ } \ } while (0) \
In fact any file creation operation with O_EXCL flag fails.
REVIEW: http://review.gluster.org/10179 (nfs: do not overwrite the return value and errno of resolve operation) posted (#1) for review on master by Raghavendra Bhat (raghavendra)
REVIEW: http://review.gluster.org/10179 (nfs: do not overwrite the return value and errno of resolve operation) posted (#2) for review on master by Raghavendra Bhat (raghavendra)
COMMIT: http://review.gluster.org/10179 committed in master by Niels de Vos (ndevos) ------ commit 7c7bbc027feb4c5b233e3078951e5bb1d9fc4618 Author: Raghavendra Bhat <raghavendra> Date: Thu Apr 9 18:44:23 2015 +0530 nfs: do not overwrite the return value and errno of resolve operation * In auth status check which is done in the resume function, the op_ret and op_errno values saved in nfs3_call_state are overwritten by the return value of the auth status check function. Change-Id: Id4682ddd399c78a1cef6313a534892ef309c57a6 BUG: 1210338 Signed-off-by: Raghavendra Bhat <raghavendra> Reviewed-on: http://review.gluster.org/10179 Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Venky Shankar <vshankar> Reviewed-by: Niels de Vos <ndevos>
*** Bug 1208134 has been marked as a duplicate of this bug. ***
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report. glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution. [1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939 [2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user