Bug 765475 (GLUSTER-3743)

Summary: nfs.volume-access: read-only [Does NOT work]
Product: [Community] GlusterFS Reporter: Saul Serna <sserna>
Component: cliAssignee: Krishna Srinivas <krishna>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2.4CC: fharshav, gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Saul Serna 2011-10-20 00:56:32 UTC
I came across this bug while tuning volume options. Despite setting nfs to "read-only"....I am still able to create and modify files.




[root@ss-node1 ~]# gluster volume set repo nfs.volume-access read-only
Set volume successful
[root@ss-node1 ~]#
[root@ss-node1 ~]#
[root@ss-node1 ~]#
[root@ss-node1 ~]# gluster volume info
Volume Name: repo
Type: Distributed-Replicate
Status: Started
Number of Bricks: 3 x 2 = 6
Transport-type: tcp
Bricks:
Brick1: 10.1.15.11:/mnt/repo
Brick2: 10.1.15.12:/mnt/repo
Brick3: 10.1.15.13:/repo2
Brick4: 10.1.15.14:/repo2
Brick5: 10.1.15.13:/repo
Brick6: 10.1.15.14:/repo
Options Reconfigured:
nfs.volume-access: read-only          <<===== SET TO READ-ONLY
diagnostics.count-fop-hits: on
diagnostics.latency-measurement: on
[root@ss-node1 ~]#
[root@ss-node1 ~]#
[root@ss-node1 ~]#
[root@ss-node1 ~]# mount -t nfs 10.1.15.11:/repo /tmp/repo-mount
[root@ss-node1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             9.5G  1.9G  7.1G  21% /
/dev/sda1             122M   16M  100M  14% /boot
tmpfs                 249M     0  249M   0% /dev/shm
/dev/sdb1             1.8G   65M  1.6G   4% /mnt/repo
10.1.15.11:/repo      3.5G  145M  3.2G   5% /tmp/repo-mount
[root@ss-node1 ~]#
[root@ss-node1 ~]#
[root@ss-node1 ~]#
[root@ss-node1 ~]# cd /tmp/repo-mount
[root@ss-node1 repo-mount]#
[root@ss-node1 repo-mount]# touch foo
[root@ss-node1 repo-mount]# vi a
[root@ss-node1 repo-mount]#
[root@ss-node1 repo-mount]#
[root@ss-node1 repo-mount]#
[root@ss-node1 repo-mount]# ls -als a foo
8 -rw-r--r-- 1 root root 33 Oct 20 00:39 a
4 -rw-r--r-- 1 root root  0 Oct 20 00:38 foo

Comment 1 Krishna Srinivas 2011-10-31 04:58:41 UTC
Saul,

On which release did you try this?

I tried on 3.2 and main branch, both work fine:

root@escape:~# /opt/glusterfs/sbin/gluster volume set test1 nfs.volume-access read-only
Set volume successful
root@escape:~# cd /mnt/nfs
root@escape:/mnt/nfs# mkdir ddd
mkdir: cannot create directory `ddd': Read-only file system
root@escape:/mnt/nfs#

Comment 2 Saul Serna 2011-11-01 15:16:06 UTC

I tested this using 3.2.4 on my personal nodes.

Comment 3 Harshavardhana 2011-11-07 20:59:45 UTC
(In reply to comment #2)
> 
> I tested this using 3.2.4 on my personal nodes.

Tested this with 3.2.3 on Fedora 15 


[root@sysrq fharshav]# gluster volume info

Volume Name: hello
Type: Distribute
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: 10.14.16.156:/tmp/test1
Brick2: 10.14.16.156:/tmp/test2
Options Reconfigured:
nfs.volume-access: read-only

mount -overs=3 localhost:/hello /tmp/nfs

[root@sysrq fharshav]# cd /tmp/nfs/
[root@sysrq nfs]# touch a
touch: cannot touch `a': Read-only file system
[root@sysrq nfs]#

Can you test again saul?

Comment 4 Krishna Srinivas 2011-11-15 07:08:38 UTC
Saul, Just to be sure I tried on 3.2.4 also and it worked as expected. Let us know if it does not work for you when you try it again. I will close this bug for now.