Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 311221

Summary: NFS inherited read-only
Product: Red Hat Enterprise Linux 5 Reporter: Red Hat Production Operations <soc>
Component: kernelAssignee: Jeff Layton <jlayton>
Status: CLOSED DUPLICATE QA Contact: Martin Jenner <mjenner>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: staubach, steved
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: 2007-09-28 17:46:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Red Hat Production Operations 2007-09-28 15:45:27 UTC
We have two nfs exports that are being served from a NetApp filer and are
mounted on a RHEL5 x86_64 machine running 2.4.9-e.70smp.

The exports are mounted as such:
192.168.0.20:/vol/www/www.example.com on /var/www/www.example.com type nfs
(ro,nosuid,nodev,noatime,nolock,hard,intr,bg,nfsvers=3,rsize=32768,actimeo=15,addr=192.168.0.20)

192.168.0.20:/vol/www/www.example.com-logs/logs/spool on
/var/log/httpd/nfs/spool type nfs
(rw,nosuid,nodev,noatime,hard,intr,bg,nfsvers=3,rsize=4096,wsize=4096,addr=192.168.0.20)

Note that the mount on /var/www/www.example.com is read-only and the mount on
/var/log/httpd/nfs/spool is read-write.

The export configuration on the filer is valid and is properly exported (and
flushed prior for good measure):
/vol/www/www.example.com-logs    -sec=sys,rw=192.168.0.101
/vol/www/www.example.com    -sec=sys,ro=192.168.0.101

When /vol/www/www.example.com is mounted first, and
/vol/www/www.example.com-logs is mounted second, /vol/www/www.example.com-logs
incorrectly inherits /vol/www/www.example.com's read-only access.

Example:
[root.0.101 ~]# mount -t nfs 192.168.0.20:/vol/www/www.example.com
/var/www/www.example.com -o
ro,nolock,hard,intr,bg,noatime,nodev,nosuid,nfsvers=3,rsize=32768,actimeo=15,async
[root.0.101 ~]# mount | grep nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
192.168.0.20:/vol/www/www.example.com on /var/www/www.example.com type nfs
(ro,nosuid,nodev,noatime,nolock,hard,intr,bg,nfsvers=3,rsize=32768,actimeo=15,addr=10.8.2.20)
[root.0.101 ~]# mount -t nfs
192.168.0.20:/vol/www/www.example.com-logs/logs/spool /var/log/httpd/nfs/spool
-o defaults,rw,hard,intr,bg,noatime,nodev,nosuid,nfsvers=3,rsize=4096,wsize=4096
[root.0.101 ~]# mount | grep nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
192.168.0.20:/vol/www/www.example.com on /var/www/www.example.com type nfs
(ro,nosuid,nodev,noatime,nolock,hard,intr,bg,nfsvers=3,rsize=32768,actimeo=15,addr=10.8.2.20)
192.168.0.20:/vol/www/www.example.com-logs/logs/spool on
/var/log/httpd/nfs/spool type nfs
(rw,nosuid,nodev,noatime,hard,intr,bg,nfsvers=3,rsize=4096,wsize=4096,addr=10.8.2.20)
[root.0.101 ~]# touch /var/log/httpd/nfs/spool/test.txt
touch: cannot touch `/var/log/httpd/nfs/spool/test.txt': Read-only file system

/var/log/httpd/nfs/spool/ shows as being mounted read-write yet I am incorrectly
told it is read-only and prevented from touch a file on it.

When /vol/www/www.redhat.com-logs is mounted first, and /vol/www/www.example.com
is mounted second, /vol/www/www.example.com-logs is properly set to read-write.

Example:
[root.0.101 ~]# umount -a -t nfs
[root.0.101 ~]# mount | grep nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
[root.0.101 ~]# mount -t nfs
192.168.0.20:/vol/www/www.example.com-logs/logs/spool /var/log/httpd/nfs/spool
-o defaults,rw,hard,intr,bg,noatime,nodev,nosuid,nfsvers=3,rsize=4096,wsize=4096
[root.0.101 ~]# mount | grep nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
192.168.0.20:/vol/www/www.example.com-logs/logs/spool on
/var/log/httpd/nfs/spool type nfs
(rw,nosuid,nodev,noatime,hard,intr,bg,nfsvers=3,rsize=4096,wsize=4096,addr=10.8.2.20)
[root.0.101 ~]# mount -t nfs 192.168.0.20:/vol/www/www.example.com
/var/www/www.example.com -o
ro,nolock,hard,intr,bg,noatime,nodev,nosuid,nfsvers=3,rsize=32768,actimeo=15,async
[root.0.101 ~]# mount | grep nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
192.168.0.20:/vol/www/www.example.com-logs/logs/spool on
/var/log/httpd/nfs/spool type nfs
(rw,nosuid,nodev,noatime,hard,intr,bg,nfsvers=3,rsize=4096,wsize=4096,addr=10.8.2.20)
192.168.0.20:/vol/www/www.example.com on /var/www/www.example.com type nfs
(ro,nosuid,nodev,noatime,nolock,hard,intr,bg,nfsvers=3,rsize=32768,actimeo=15,addr=10.8.2.20)
[root.0.101 ~]# touch /var/log/httpd/nfs/spool/test.txt
[root.0.101 ~]# ll /var/log/httpd/nfs/spool/test.txt
-rw-r--r-- 1 root root 0 Sep 28 11:36 /var/log/httpd/nfs/spool/test.txt

This is reproducible every time.

My theory is that the kernel is doing a partial name match on the export name
when determining the type of access it has. This problem does not appear in
older versions of RHEL.

Please advise.

Comment 1 Jeff Layton 2007-09-28 17:46:20 UTC
Sounds like a dupe of bug #209964, except that this doesn't make much sense:

> We have two nfs exports that are being served from a NetApp filer and are
> mounted on a RHEL5 x86_64 machine running 2.4.9-e.70smp.

I'm going to assume that this is a mistake and you're not actually running a
RHEL5 machine with a RHEL2.1 kernel. If it's not a mistake then go ahead and
reopen this bug and explain why you have such a crazy configuration.


*** This bug has been marked as a duplicate of 209964 ***