All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Lothar Waßmann" <LW@KARO-electronics.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: linux-2.6.25: 'mkdir -p' does not work with rootdir as mount point inside a read only filesystem
Date: Thu, 1 May 2008 21:52:31 -0700	[thread overview]
Message-ID: <20080501215231.297e0d9d.akpm@linux-foundation.org> (raw)
In-Reply-To: <18456.34604.472989.35082@ipc1.ka-ro>

On Wed, 30 Apr 2008 16:50:20 +0200 Lothar Wa__mann <LW@KARO-electronics.de> wrote:

> Hi,

(y'know that ~4000 people read your email and hit 'n'?  Except for me?
That's one bug I'd like to get fixed)

> when trying to create a directory path with 'mkdir -p' with the root
> being a mount point of a writeable filesystem that exists inside a
> read-only file system, mkdir return -EROFS.
> 
> This was tested with the latest git-tree from:
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
> 
> The last kernel I know of this has been working was 2.6.22.
> 
> E.g.:
> |root@triton1:/# mount
> |rootfs on / type rootfs (rw)
> |/dev/root on / type jffs2 (ro)
> |proc on /proc type proc (rw)
> |sysfs on /sys type sysfs (rw)
> |/dev/root on /dev/.static/dev type jffs2 (ro)
> |tmpfs on /dev type tmpfs (rw,size=10240k,mode=755)
> |tmpfs on /var type tmpfs (rw)
> |tmpfs on /tmp type tmpfs (rw)
> |devpts on /dev/pts type devpts (rw,gid=5,mode=620)
> |tmpfs on /dev/shm type tmpfs (rw)
> |root@triton1:/# mkdir -p /dev/.udev/db
> |mkdir: Cannot create directory `/dev/': Read-only file system
> 
> While:
> |root@triton1:/# cd /dev
> |root@triton1:/# mkdir -p .udev/db
> works as expected...
> 
> Has anyone else encountered this problem already?
> I've searched the archives but could not find anything related to this
> problem.

I had a shot at scripting this, but for me, everything works OK.

#!/bin/sh
dd if=/dev/zero of=file1 bs=1M count=32
dd if=/dev/zero of=file2 bs=1M count=32
yes | mkfs -t ext2 file1
yes | mkfs -t ext2 file2
mkdir -p mountpoint
mount -o loop file1 mountpoint
mkdir mountpoint/dir
umount mountpoint
mount -o loop,ro file1 mountpoint
mount -o loop file2 mountpoint/dir
mkdir -p $(/bin/pwd)/mountpoint/dir/subdir


are you able to modify the above so that it demonstrates the failure?

Thanks.

  reply	other threads:[~2008-05-02  4:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30 14:50 linux-2.6.25: 'mkdir -p' does not work with rootdir as mount point inside a read only filesystem Lothar Waßmann
2008-05-02  4:52 ` Andrew Morton [this message]
2008-05-02  6:55   ` NeilBrown
2008-05-03  6:32     ` Willy Tarreau
2008-05-05  6:27       ` Lothar Waßmann
2008-05-05  7:02         ` Willy Tarreau
2008-05-05  7:08           ` Lothar Waßmann
2008-05-05  7:28             ` Willy Tarreau
2008-05-05  7:38               ` Lothar Waßmann
2008-05-05 12:02                 ` Al Viro
2008-05-02 11:32   ` Dan Noé

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=20080501215231.297e0d9d.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=LW@KARO-electronics.de \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.