Bug 1163703

Summary: [USS]: If the snap name is same as snap-directory than cd to virtual snap directory fails
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Rahul Hinduja <rhinduja>
Component: snapshotAssignee: Vijaikumar Mallikarjuna <vmallika>
Status: CLOSED ERRATA QA Contact: Rahul Hinduja <rhinduja>
Severity: urgent Docs Contact:
Priority: urgent    
Version: unspecifiedCC: nsathyan, rhs-bugs, rjoseph, smohan, storage-qa-internal, surs, vagarwal, vmallika
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.0.3   
Hardware: x86_64   
OS: Linux   
Whiteboard: USS
Fixed In Version: glusterfs-3.6.0.33-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1164613 (view as bug list) Environment:
Last Closed: 2015-01-15 13:42:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1162694, 1164613, 1175733    

Description Rahul Hinduja 2014-11-13 10:24:01 UTC
Description of problem:
=======================

In a scenario, if the snap name is same as the snap-directory than cd to snaps/snaps fails.

For example:
============

The snap directory is changed to snaps as follows

[root@inception ~]# gluster v set vol0 snapshot-directory snaps
volume set: success
[root@inception ~]#

Snapshot is created with name snaps

[root@inception ~]# gluster snapshot create snaps vol0
snapshot create: success: Snap snaps created successfully
[root@inception ~]#

From client cd to snaps/snaps from fuse client fails

[root@wingo ~]# cd /mnt/vol0
[root@wingo vol0]# 
[root@wingo vol0]# cd snaps/snaps
bash: cd: snaps/snaps: No such file or directory
[root@wingo vol0]# cd snaps/
[root@wingo snaps]# ls
snaps
[root@wingo snaps]# ls snaps
ls: cannot access snaps: No such file or directory
[root@wingo snaps]# ls -lrt snaps
ls: cannot access snaps: No such file or directory
[root@wingo snaps]# ls -lrt
total 0
d---------. 0 root root 0 Jan  1  1970 snaps
[root@wingo snaps]#


Version-Release number of selected component (if applicable):
==============================================================

glusterfs-3.6.0.32-1.el6rhs.x86_64


How reproducible:
=================

always


Steps to Reproduce:
====================
1. Create 2x2 volume
2. Enable the uss on volume
3. Change the snapshot-directory to snaps
4. Create a snapshot (snaps) of the volume 
5. Mount the volume (fuse)
6. From mount, cd to snaps/snaps

Actual results:
===============

cd to snaps/snaps fails with no such file or directory. Though ls lists it.


Expected results:
=================

It should be successful

Comment 3 Vijaikumar Mallikarjuna 2014-11-27 11:41:54 UTC
Patch that fixes this issue: https://code.engineering.redhat.com/gerrit/#/c/36771/

Comment 4 Rahul Hinduja 2014-11-27 12:01:08 UTC
verified with build: glusterfs-3.6.0.34-1.el6rhs.x86_64

[root@inception ~]# gluster v i vol0 | grep -i "snapshot-directory"
features.snapshot-directory: snaps
[root@inception ~]#

[root@wingo vol0]# mount | grep vol0
inception.lab.eng.blr.redhat.com:/vol0 on /mnt/vol0 type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)
[root@wingo vol0]# cd snaps/snaps
[root@wingo snaps]# pwd
/mnt/vol0/snaps/snaps
[root@wingo snaps]# cd ..
[root@wingo snaps]# pwd
/mnt/vol0/snaps
[root@wingo snaps]# cd ..
[root@wingo vol0]# pwd
/mnt/vol0
[root@wingo vol0]#


Moving the bug to verified state

Comment 6 errata-xmlrpc 2015-01-15 13:42:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0038.html