[PATCH] busybox: fix mkdir -p on read only file systems

Denys Vlasenko vda.linux at googlemail.com
Fri May 16 18:20:29 PDT 2008


On Friday 16 May 2008 09:04, Peter Korsgaard wrote:
>  Denys> Why?
> 
>  Denys> Unlike "directory already exists", "read-only fs" is the real error
>  Denys> in real-world usage - user won't be able to create files in it later.
> 
> The issue is when you span mount points, E.G. my specific problem was
> with /var on a ro mount, with /var/lib a symlink to /tmp, and trying
> to do a mkdir -p /var/lib/blah.
> 
> mkdir /var/lib/blah worked, mkdir -p didn't. With the patch it does.

Can you *show* (as opposed to "describe") the problem?
Show the successful run of coreutils' mkdir -p,
then failing bbox mkdir -p with the same argument(s),
and finally a straced run of the same failing mkdir -p.

Because I can't reproduce it. Look:

My / is a ro filesystem.
Here's how I successfully "create" with mkdir -p already existing directory:

# ls -ld /bin
dr-xr-xr-x    2 root     root         8192 Apr 29 05:56 /bin
# mkdir -p /bin

And a symlink to directory:

# ls -ld /etc
lrwxrwxrwx    1 root     root           11 May 21  2006 /etc -> /.local/etc
# mkdir -p /etc

And even create (this time for real) a new directory inside
symlinked directory:

# mkdir -p /etc/qweqwe
#

mkdir above is bbox's one.
--
vda


More information about the busybox mailing list