Bug #1570
closedHAMMER: you can newfs a mounted hammer device
0%
Description
Retry the following:
- newfs_hammer -L pgsql /dev/ad7s2d
- mount_hammer /dev/ad7s2d /usr/pkg/pgsq
- newfs /dev/ad7s2d
- umount /usr/pkg/pgsql
- mount /dev/ad7s2d /usr/pkg/pgsql
- mount | grep pgsql
dev/ad7s2d on /usr/pkg/pgsql (ufs, local)
So, it actually newfs'd the mounted hammer fs, then you can unmount
the hammer and mount the device as UFS.
I think it works because newfs looks into the mounted devices, but
there is no /dev/xyz, but only the label... so it goes on happily and
newfs maybe does not check for existing superblocks (like newfs.xfs)
and if it checks maybe it doesn't know how a hammer one looks like.
Kind Regards,
Jan Lentfer
Updated by tuxillo about 15 years ago
Based upon old sys/vfs/specfs/spec_vnops.c
Updated by tuxillo about 15 years ago
Updated by tuxillo about 15 years ago
Previous submits are wrong, please don't commit. Sorry for the noise
Updated by tuxillo about 15 years ago
Hi,
I think this is more appropiate:
http://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff/b5aed088da7d167b707f30b690fe8fc220e7cbb2
Updated by tuxillo about 15 years ago
Finally I did last changes by request:
http://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff/87b0928085ae33591193b69255bd35cc46e5a5ed
I've tested it and it seems to work:
Writing to R/O is permitted.
-------------------------------------------------
vmware# mount -o ro /dev/da0s1d /mnt/test/
vmware# ./testwrite da0s1d
Opened /dev/da0s1d for writing: fd 3
Writing to R/W not allowed
-------------------------------------
vmware# umount /mnt/test/
vmware# mount -o rw /dev/da0s1d /mnt/test/
vmware# ./testwrite ad0s1a
/dev/ad0s1a opening failed
open: Device busy
When securelevel set >= 1, no writing allowed
-------------------------------------------------
vmware# umount /mnt/test/
vmware# mount -o ro /dev/da0s1d /mnt/test/
vmware# sysctl kern.securelevel=1
kern.securelevel: -1 -> 1
vmware# ./testwrite da0s1d
/dev/da0s1d opening failed
open: Operation not permitted
Updated by tuxillo about 15 years ago
Fix committed in ddd7de8218ab45cb082d928d8573a7ca48b3c131