mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Thomas Zeitlhofer <tzeitlho+lkml@nt.tuwien.ac.at>
Cc: linux-kernel@vger.kernel.org
Subject: Re: mkdir on read-only NFS is broken in 2.6.18
Date: Mon, 23 Oct 2006 06:33:42 -0400	[thread overview]
Message-ID: <1161599622.5755.16.camel@lade.trondhjem.org> (raw)
In-Reply-To: <20061023092329.GA5231@swan.nt.tuwien.ac.at>

On Mon, 2006-10-23 at 11:23 +0200, Thomas Zeitlhofer wrote:
> Hello,
> 
> there is a problem in 2.6.18/.1 when mkdir is called for an existing
> directory on a read-only mounted NFS filesystem.
> 
> Lets consider a server that exports the directory /export which contains
> the directory-tree a/b/c:
> 
> 1) If /export is mounted ro and the first access to a, b, or c  is
> mkdir, then this directory and all directories underneath become
> inaccessible:
> 
>   client:# mount server:/export /mnt -o ro
>   client:# mkdir /mnt/a/b
>   mkdir: cannot create directory `/mnt/a/b': Read-only file system
>   client:# find /mnt
>   /mnt
>   /mnt/a
>   find: /mnt/a/b: No such file or directory
> 
> 2) If /export is mounted ro and the first access to a, b, or c  is _not_
> by calling mkdir, then a following mkdir does not destroy the directory
> structure (and mkdir now returns EEXIST):
> 
>   client:# mount server:/export /mnt -o ro
>   client:# find /mnt
>   /mnt
>   /mnt/a
>   /mnt/a/b
>   /mnt/a/b/c
>   client:# mkdir /mnt/a/b
>   mkdir: cannot create directory `/mnt/a/b': File exists
>   client:# find /mnt
>   /mnt
>   /mnt/a
>   /mnt/a/b
>   /mnt/a/b/c
> 
> 3) If /export is mounted rw (although exported ro), then mkdir does not
> destroy the directory structure:
> 
>   client:# mount server:/export /mnt -o rw
>   client:# mkdir /mnt/a/b
>   mkdir: cannot create directory `/mnt/a/b': Read-only file system
>   client:# find /mnt
>   /mnt
>   /mnt/a
>   /mnt/a/b
>   /mnt/a/b/c
> 
> As a consequence of 1), autofs does not work with mountpoints on NFS
> (ro) because the automount daemon calls mkdir for all directories in the
> path to the mountpoint. This seems related to the discussion [1], and,
> as suggested in [1], the issue is fixed by reverting the patch:

There should already be a fix for this issue in 2.6.19-rc1. See

  http://kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fd6840714d9cf6e93f1d42b904860a94df316b85

Note, though, that the autofs behaviour that you describe above is
seriously broken (mkdir as root on an NFS partition is _not_
acceptable).

Cheers,
  Trond


  reply	other threads:[~2006-10-23 10:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-23  9:23 Thomas Zeitlhofer
2006-10-23 10:33 ` Trond Myklebust [this message]
2006-10-23 13:14   ` Thomas Zeitlhofer
2006-10-24 14:01 ` automount nfs: mkdir_path /net/host/dir failed: Read-only file system Frank van Maarseveen

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=1161599622.5755.16.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzeitlho+lkml@nt.tuwien.ac.at \
    /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

Powered by JetHome