Linux NFS development
 help / color / mirror / Atom feed
From: Michael Walker <Michael.Walker@Cassatt.COM>
To: nfs@lists.sourceforge.net
Cc: michael.walker@cassatt.com
Subject: NFS mounts being mounted read-only depending upon mount order???
Date: Fri, 17 Nov 2006 10:22:58 -0800	[thread overview]
Message-ID: <455DFE02.7050801@Cassatt.COM> (raw)


All,

I'm having problems with the latest version of FC5 which
contains kernel 2.6.18 - the problem is that NFS mounts
of read-write file-systems are being mounted read-only, sometimes.

Whether a mount is mounted read-only or read-write seems
to very depending upon what other directories were
mounted from the same server and with what options.

Take the following file-systems exported from my
Linux Server server:

    root@polyslo:/proc/fs/nfs# cat /etc/exports
    /disk1/dir_ro   *(ro,no_root_squash,sync,wdelay,no_subtree_check)
    /disk1/dir_rw   *(rw,no_root_squash,sync,wdelay,no_subtree_check)
    root@polyslo:/proc/fs/nfs# showmount -e 10.20.20.48
    Export list for 10.20.20.48:
    /disk1/dir_rw *
    /disk1/dir_ro *
    root@polyslo:/proc/fs/nfs#

If I now do the following mounts (in this order):

    # Mount initial directory read-only - this is intentional
    mount -t nfs -o ro 10.20.20.48:/disk1/dir_ro /tmp/dir_ro

    # Attempt to mount second directory read-write
    mount -t nfs -o rw 10.20.20.48:/disk1/dir_rw /tmp/dir_rw

    # Now I attempt to touch a file in the rw directory:
    [root@vt-1 tmp]# touch /tmp/dir_rw/hello
    touch: cannot touch `/tmp/dir_rw/hello': Read-only file system

    # And if I take a look in the /proc/mounts directory - I see
    # that the directory was truly mounted read-only

    [root@vt-1 tmp]# grep 10.20.20.48 /proc/mounts
    10.20.20.48:/disk1/dir_ro /tmp/dir_ro nfs ro,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=10.20.20.48 0 0
    10.20.20.48:/disk1/dir_rw /tmp/dir_rw nfs ro,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=10.20.20.48 0 0
    [root@vt-1 tmp]#

The above seems wrong to me - can someone clarify what's going on.
I know that this is new behavior that was not true in the past.  My
RHEL_4U4 server running 2.6.9 kernel does not have this problem.

Notice that if I change the order of the mounts I get different behavior:

    # Initially mount the read-write directory:
    mount -t nfs -o rw 10.20.20.48:/disk1/dir_rw /tmp/dir_rw

    # Then mount the read-only directory:
    mount -t nfs -o ro 10.20.20.48:/disk1/dir_ro /tmp/dir_ro

    # Now the directories are mounted as I wish, I can write to the
    # read-write mount:
    [root@vt-1 tmp]# touch /tmp/dir_rw/hello
    [root@vt-1 tmp]#

    # And the read-only directory is read-only:
    [root@vt-1 tmp]# touch /tmp/dir_ro/hello
    touch: cannot touch `/tmp/dir_ro/hello': Read-only file system
    [root@vt-1 tmp]#

    # And the /proc/mounts file reflects the states I expect
    [root@vt-1 tmp]# grep 10.20.20.48 /proc/mounts
    10.20.20.48:/disk1/dir_rw /tmp/dir_rw nfs rw,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=10.20.20.48 0 0
    10.20.20.48:/disk1/dir_ro /tmp/dir_ro nfs rw,vers=3,rsize=32768,wsize=32768,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=10.20.20.48 0 0
    [root@vt-1 tmp]#


Note that previously the order did not matter and the permissions
always reflected the permissions of the individual mount requests.

If someone could provide insights on what's going on above that
would be great.  This is a artificial test case - but it's actually
hitting code we have in production and will be a significant
issue for us.

Thanx much!

_Mike_

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

             reply	other threads:[~2006-11-17 18:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-17 18:22 Michael Walker [this message]
2006-11-20 20:57 ` NFS mounts being mounted read-only depending upon mount order??? Michael Walker
2006-11-20 21:10   ` Trond Myklebust
2006-11-20 21:22     ` Michael Walker
2006-11-20 21:43       ` Trond Myklebust
2006-11-20 22:00         ` Michael Walker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=455DFE02.7050801@Cassatt.COM \
    --to=michael.walker@cassatt.com \
    --cc=nfs@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox