Bug 1210338 - file copy operation fails on nfs
Summary: file copy operation fails on nfs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: nfs
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Raghavendra Bhat
QA Contact:
URL:
Whiteboard:
: 1208134 (view as bug list)
Depends On:
Blocks: qe_tracker_everglades
TreeView+ depends on / blocked
 
Reported: 2015-04-09 13:29 UTC by Raghavendra Bhat
Modified: 2015-05-14 17:35 UTC (History)
5 users (show)

Fixed In Version: glusterfs-3.7.0beta1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-14 17:27:16 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Raghavendra Bhat 2015-04-09 13:29:07 UTC
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)                                                     \

Comment 1 Raghavendra Bhat 2015-04-09 13:36:58 UTC
In fact any file creation operation with O_EXCL flag fails.

Comment 2 Anand Avati 2015-04-09 13:47:01 UTC
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)

Comment 3 Anand Avati 2015-04-09 14:20:13 UTC
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)

Comment 4 Anand Avati 2015-04-13 05:47:35 UTC
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>

Comment 5 Niels de Vos 2015-04-13 06:00:38 UTC
*** Bug 1208134 has been marked as a duplicate of this bug. ***

Comment 6 Niels de Vos 2015-05-14 17:27:16 UTC
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

Comment 7 Niels de Vos 2015-05-14 17:28:43 UTC
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

Comment 8 Niels de Vos 2015-05-14 17:35:19 UTC
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


Note You need to log in before you can comment on or make changes to this bug.