Bug 1168875 - [USS]: browsing .snaps directory with CIFS fails with "Invalid argument"
Summary: [USS]: browsing .snaps directory with CIFS fails with "Invalid argument"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: pre-release
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard: USS
Depends On: 1119710
Blocks: 1154965 1175742
TreeView+ depends on / blocked
 
Reported: 2014-11-28 09:48 UTC by rjoseph
Modified: 2015-05-14 17:45 UTC (History)
14 users (show)

Fixed In Version: glusterfs-3.7.0
Doc Type: Bug Fix
Doc Text:
Clone Of: 1119710
: 1175742 (view as bug list)
Environment:
Last Closed: 2015-05-14 17:28:37 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Comment 1 Anand Avati 2014-11-28 09:58:40 UTC
REVIEW: http://review.gluster.org/9211 (uss: CIFS gives error while accessing .snaps directory) posted (#1) for review on master by Rajesh Joseph (rjoseph)

Comment 2 Anand Avati 2014-11-29 14:18:31 UTC
REVIEW: http://review.gluster.org/9211 (uss: CIFS gives error while accessing .snaps directory) posted (#2) for review on master by Raghavendra Bhat (raghavendra)

Comment 3 Anand Avati 2014-12-01 12:42:43 UTC
REVIEW: http://review.gluster.org/9211 (uss: CIFS gives error while accessing .snaps directory) posted (#3) for review on master by Raghavendra Bhat (raghavendra)

Comment 4 Anand Avati 2014-12-01 12:42:47 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#2) for review on master by Raghavendra Bhat (raghavendra)

Comment 5 Anand Avati 2014-12-01 14:10:44 UTC
REVIEW: http://review.gluster.org/9211 (uss: CIFS gives error while accessing .snaps directory.) posted (#4) for review on master by Raghavendra Bhat (raghavendra)

Comment 6 Anand Avati 2014-12-01 14:11:03 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#3) for review on master by Raghavendra Bhat (raghavendra)

Comment 7 Anand Avati 2014-12-01 14:27:14 UTC
REVIEW: http://review.gluster.org/9211 (uss: CIFS gives error while accessing .snaps directory) posted (#5) for review on master by Raghavendra Bhat (raghavendra)

Comment 8 Anand Avati 2014-12-01 14:27:18 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#4) for review on master by Raghavendra Bhat (raghavendra)

Comment 11 Anand Avati 2014-12-02 13:13:59 UTC
REVIEW: http://review.gluster.org/9211 (uss: CIFS gives error while accessing .snaps directory) posted (#6) for review on master by Raghavendra Bhat (raghavendra)

Comment 12 Anand Avati 2014-12-02 13:14:04 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#5) for review on master by Raghavendra Bhat (raghavendra)

Comment 13 Anand Avati 2014-12-02 15:35:40 UTC
REVIEW: http://review.gluster.org/9211 (uss: CIFS gives error while accessing .snaps directory) posted (#7) for review on master by Rajesh Joseph (rjoseph)

Comment 14 Anand Avati 2014-12-03 04:43:31 UTC
REVIEW: http://review.gluster.org/9211 (uss: CIFS gives error while accessing .snaps directory) posted (#8) for review on master by Rajesh Joseph (rjoseph)

Comment 15 Anand Avati 2014-12-03 09:10:08 UTC
REVIEW: http://review.gluster.org/9211 (uss: CIFS gives error while accessing .snaps directory) posted (#9) for review on master by Rajesh Joseph (rjoseph)

Comment 16 Anand Avati 2014-12-03 14:47:29 UTC
COMMIT: http://review.gluster.org/9211 committed in master by Vijay Bellur (vbellur) 
------
commit 8261f0deb9bf75611135a6571bc4d9cef687ad37
Author: Rajesh Joseph <rjoseph>
Date:   Fri Nov 28 15:24:46 2014 +0530

    uss: CIFS gives error while accessing .snaps directory
    
    CIFS sends getxattr call while accessing .snaps directory.
    snapview server should return ENODATA if getxattr is called
    on .snaps folder. Also flush on .snaps folder should be handled.
    
    Windows client sends and getxattr call on the parent folder
    of .snaps with a special key to get the real filename of a file.
    This is used by samba to do case insensitive check of files.
    
    Fixed few FreeBSD compilation error.
    
    bug: 1168875
    
    Change-Id: I74d5cb4419568c8ed8709ba6d1ddff0e41392204
    Signed-off-by: Rajesh Joseph <rjoseph>
    Reviewed-on: http://review.gluster.org/9211
    Reviewed-by: Raghavendra Bhat <raghavendra>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 17 Anand Avati 2014-12-03 15:19:24 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#6) for review on master by Raghavendra Bhat (raghavendra)

Comment 18 Anand Avati 2014-12-04 07:42:57 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#7) for review on master by Raghavendra Bhat (raghavendra)

Comment 19 Anand Avati 2014-12-04 14:07:44 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#8) for review on master by Raghavendra Bhat (raghavendra)

Comment 20 Anand Avati 2014-12-05 06:28:53 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#9) for review on master by Raghavendra Bhat (raghavendra)

Comment 21 Anand Avati 2014-12-05 06:54:59 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#10) for review on master by Raghavendra Bhat (raghavendra)

Comment 22 Anand Avati 2014-12-05 09:07:43 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#11) for review on master by Raghavendra Bhat (raghavendra)

Comment 23 Anand Avati 2014-12-05 11:39:27 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#12) for review on master by Raghavendra Bhat (raghavendra)

Comment 24 Anand Avati 2014-12-09 07:03:49 UTC
REVIEW: http://review.gluster.org/9218 (features/snapview-client: handle readdir requests differently for samba) posted (#13) for review on master by Raghavendra Bhat (raghavendra)

Comment 25 Anand Avati 2014-12-10 04:27:48 UTC
COMMIT: http://review.gluster.org/9218 committed in master by Vijay Bellur (vbellur) 
------
commit 7cfa31434eb132adc0ac5cba4dcde600897cd2eb
Author: Raghavendra Bhat <raghavendra>
Date:   Fri Nov 28 18:08:53 2014 +0530

    features/snapview-client: handle readdir requests differently for samba
    
    * For samba export, the entry point is also added to the readdir response.
    
    Change-Id: I825c017e0f16db1f1890bb56e086f36e6558a1c2
    BUG: 1168875
    Signed-off-by: Raghavendra Bhat <raghavendra>
    Reviewed-on: http://review.gluster.org/9218
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 26 Raghavendra Bhat 2014-12-16 06:16:40 UTC
As of now, the entry-point dentry (.snaps by default) is not sent as part of readdir response (not even in ls -a it is visible.) Because, if one does cp -r of a directory or entire glusterfs volume, then even the snapshot data will also be copied. One has to explicitly give the .snaps name while accessing snapshots (such as "ls .snaps" or "cd .snaps").

This causes problems in windows, as in windows explorer .snaps entry will not be seen. If the path of .snaps is given in the address bar (like it is done for fuse and nfs), then windows instead of sending a lookup on the entry-point, will send readdir on its parent, and checks if the dentry for the entry-point is present in readdir response or not. And since uss is not sending the entry-point in readdir, the access to is denies by windows.

So to handle this the following method is used.

Samba while starting gfapi (via the glusterfs plugin for samba), should give a xlator option that is recognized by snapview-client (the option is path in the glusterfs volume that is exported via samba or used as the share for windows). When the above option is set to a valid path, then snapview-client will add the dentry of the entry-point in the readdir response coming on that path. It is added only for the exported directory because, again in windows explorer if one selects all the directories/folders and copies, there is a possibility of snapshot data being copied from the subdirectories of the share.

Comment 27 Niels de Vos 2015-05-14 17:28:37 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 28 Niels de Vos 2015-05-14 17:35:44 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 29 Niels de Vos 2015-05-14 17:38:06 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 30 Niels de Vos 2015-05-14 17:45:03 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.