Bug 765475 - (GLUSTER-3743) nfs.volume-access: read-only [Does NOT work]
nfs.volume-access: read-only [Does NOT work]
Status: CLOSED WORKSFORME
Product: GlusterFS
Classification: Community
Component: cli (Show other bugs)
3.2.4
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Krishna Srinivas
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-19 20:56 EDT by Saul Serna
Modified: 2011-11-15 05:08 EST (History)
2 users (show)

See Also:
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:


Attachments (Terms of Use)

  None (edit)
Description Saul Serna 2011-10-19 20:56:32 EDT
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 00:58:41 EDT
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 11:16:06 EDT

I tested this using 3.2.4 on my personal nodes.
Comment 3 Harshavardhana 2011-11-07 15:59:45 EST
(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 02:08:38 EST
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.

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