Hide Forgot
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
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#
I tested this using 3.2.4 on my personal nodes.
(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?
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.