Bug 1131968

Summary: [SNAPSHOT]: snapshoted volume is read only but it shows rw attributes in mount
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: medium Docs Contact:
Priority: high    
Version: rhgs-3.0CC: asengupt, nsathyan, rhs-bugs, rjoseph, senaik, smohan, storage-qa-internal, vmallika
Target Milestone: ---   
Target Release: RHGS 3.1.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: SNAPSHOT
Fixed In Version: glusterfs-3.7.0-3.el6rhs Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1132946 (view as bug list) Environment:
Last Closed: 2015-07-29 04:35:19 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: 1132946, 1175692, 1175694, 1202842, 1223636    

Description Rahul Hinduja 2014-08-20 12:17:18 UTC
Description of problem:
=======================

When a snapshot of a volume is created, it is readonly volume. If you mount the volume to the client it doesn't allow writes, but its attributes are rw which contradicts the functionality.

For example, snap1 is the snapshoted volume

#mount the snap volume

[root@wingo ~]# mount -t glusterfs inception.lab.eng.blr.redhat.com:/snaps/snap1/vol1 /mnt/snap1
[root@wingo ~]# 

#cd to the mount
[root@wingo ~]# cd /mnt/snap1

#Try to create a dir
[root@wingo snap1]# mkdir a
mkdir: cannot create directory `a': Read-only file system
[root@wingo snap1]# 

Note: The snap volume is mounted as readonly file system

#Look for the mount attributes

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

The mount attributes are rw which means it is allowed to read and write as well. It should be ro(readonly)

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

glusterfs-3.6.0.27-1.el6rhs.x86_64


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


Steps to Reproduce:
===================
1. Create a snapshot of a volume
2. Mount the snap volume to the client
3. Grep for mount attributes

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

mount attributes are shown as (rw)

Expected results:
=================
mount attributes should show (ro)

Comment 2 Vijaikumar Mallikarjuna 2014-08-22 11:48:37 UTC
We are mounting snapshot bricks with 'rw' options because when snapshots are activated, during brick start-up some xlators like 'posix xlators' tries to set xattrs and this will fail if the bricks are mounted readonly.

Comment 5 senaik 2015-06-22 12:22:26 UTC
Version : glusterfs-3.7.1-4.el6rhs.x86_64

Steps :
======
1) Create a snapshot and activate it.
gluster snapshot create S1 vol0
snapshot create: success: Snap S1_GMT-2015.06.22-11.54.18 created successfully
[root@inception scripts]# gluster snapshot activate S1_GMT-2015.06.22-11.54.18
Snapshot activate: S1_GMT-2015.06.22-11.54.18: Snap activated successfully

2) Mount the snap volume on the client 

mount -t glusterfs 10.70.34.50:/snaps/S2_GMT-2015.06.22-12.11.15/vol0 /mnt/S2

cd /mnt/S2
[root@dhcp35-63 S2]# mkdir a 
mkdir: cannot create directory `a': Read-only file system

3)grep for mount attributes:
 
mount | grep S2_GMT-
10.70.34.50:/snaps/S2_GMT-2015.06.22-12.11.15/vol0 on /mnt/S2 type fuse.glusterfs (ro,default_permissions,allow_other,max_read=131072)

it shows Read-Only 

Marking  the bug 'Verified'

Comment 7 errata-xmlrpc 2015-07-29 04:35:19 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/RHSA-2015-1495.html