2 # This is just for the record.
3 # This test is not run.
5 # Copyright (C) 2005 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 # Test for the 2005-10-13 patch to lib/mkdir-p.c that fixed this sort
25 # "mkdir -p /a/b/c" no longer fails merely because a leading prefix
26 # directory (e.g., /a or /a/b) exists on a read-only file system.
28 # Demonstrate the problem, as root:
33 && dd if=/dev/zero of=1 bs=8192 count=50 \
34 && dd if=/dev/zero of=2 bs=8192 count=50 \
35 && mkdir -p mnt-ro && mkfs -t ext2 1 && mkfs -t ext2 2 \
36 && $mount -o loop=/dev/loop3 1 mnt-ro \
37 && mkdir -p mnt-ro/rw \
38 && $mount -o remount,ro mnt-ro \
39 && $mount -o loop=/dev/loop4 2 mnt-ro/rw
41 mkdir -p mnt-ro/rw/sub || fail=1