Bug 380171

Summary: NFS client is confused by different exports from same filesystem
Product: Red Hat Enterprise Linux 5 Reporter: Ben Slusky <sluskyb>
Component: kernelAssignee: Red Hat Kernel Manager <kernel-mgr>
Status: CLOSED DUPLICATE QA Contact: Martin Jenner <mjenner>
Severity: high Docs Contact:
Priority: low    
Version: 5.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-13 18:45:55 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 Ben Slusky 2007-11-13 15:30:21 UTC
Description of problem:

I'm trying to mount two NFS shares, one read-only and one read-write. The shares
live on the same filesystem on the same server. The NFS client seems to mount
the second share with the same permissions as the first share, i.e. if I try to
mount the read-write share after the read-only share, the read-write share will
be mounted read-only as well.


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

kernel-2.6.18-8.1.15.el5


How reproducible:

Always.


Steps to Reproduce:

# uname -a
Linux nfsclientbox 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22 08:32:28 EDT 2007 x86_64
x86_64 x86_64 GNU/Linux
# ssh fileserver grep test-r /etc/exports
/vol01/test-ro          172.25.0.0/16(ro)
/vol01/test-rw          172.25.0.0/16(rw)
# mkdir /mnt/test-ro /mnt/test-rw
# mount -t nfs -o ro fileserver:/vol01/test-ro /mnt/test-ro
# mount -t nfs -o rw fileserver:/vol01/test-rw /mnt/test-rw
# grep fileserver /etc/mtab
fileserver:/vol01/test-ro /mnt/test-ro nfs ro,addr=1.2.3.4 0 0
fileserver:/vol01/test-rw /mnt/test-rw nfs rw,addr=1.2.3.4 0 0
# grep fileserver /proc/mounts
fileserver:/vol01/test-ro /mnt/test-ro nfs
ro,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=fileserver
0 0
fileserver:/vol01/test-rw /mnt/test-rw nfs
ro,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=fileserver
0 0
#
# touch /mnt/test-ro/foobar
touch: cannot touch `/mnt/test-ro/foobar': Read-only file system
# touch /mnt/test-rw/foobar
touch: cannot touch `/mnt/test-rw/foobar': Read-only file system
#
# umount /mnt/test-ro /mnt/test-rw
# mount -t nfs -o rw fileserver:/vol01/test-rw /mnt/test-rw
# mount -t nfs -o ro fileserver:/vol01/test-ro /mnt/test-ro
# grep fileserver /etc/mtab
fileserver:/vol01/test-rw /mnt/test-rw nfs rw,addr=1.2.3.4 0 0
fileserver:/vol01/test-ro /mnt/test-ro nfs ro,addr=1.2.3.4 0 0
# grep fileserver /proc/mounts
fileserver:/vol01/test-rw /mnt/test-rw nfs
rw,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=fileserver
0 0
fileserver:/vol01/test-ro /mnt/test-ro nfs
rw,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=fileserver
0 0
#
# touch /mnt/test-ro/foobar
touch: cannot touch `/mnt/test-ro/foobar': Read-only file system
# touch /mnt/test-rw/foobar
# ls /mnt/test-rw/foobar
/mnt/test-rw/foobar


Expected results:

 * Should have been able to touch /mnt/test-rw/foobar the first time
 * /proc/mounts should always show /mnt/test-ro mounted read-only and
/mnt/test-rw mounted read-write


Additional info:

Bug seems to be present in some stock FC5 kernels as well (observed on
2.6.18-1.2257.fc5). Maybe due to NFS client code rewrite?

Comment 1 Jeff Layton 2007-11-13 18:45:55 UTC
This is already fixed in 5.1


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