mounted snapshots still writeable 1.5 years later (RE: kern/68576)

Robert Watson rwatson at FreeBSD.org
Fri Nov 11 11:01:16 PST 2005


On Fri, 11 Nov 2005, John Kozubik wrote:

> In July of 2004 (circa 5.2.1-RELEASE) I filed kern/68576 which described 
> how snapshot files can be mounted read/write and altered.  New files can 
> be added to them, existing files can be deleted or altered, and the 
> snapshot file can be returned to read-only state and still be used.
>
> It was generally agreed that this was a bad thing - it is unexpected 
> behavior that contradicts the technical requirements of UFS2 snapshots 
> as well as the behavior that the FreeBSD documentation provides.  It is 
> also potentially dangerous.
>
> It is now Nov. 2005, circa 5.4-RELEASE, and the behavior described in 
> this PR has not changed.

Could you try it on 6.x?  There have been a number of changes relating to 
writable mounting and md devices in 6.x in order to correct related 
problems, and my understand was they should also fix this one.  FYI, 
locally, I get:

peppercorn# mdconfig -a -t vnode -f test
WARNING: opening backing store: /mnt/.snap/test readonly
md1
peppercorn# mount /dev/md1 /mnt2
mount: /dev/md1: Read-only file system
peppercorn# mount -o rdonly /dev/md1 /mnt2
peppercorn# ls -l
total 2
drwxrwxr-x  2 root  operator  512 Nov 11 18:56 .snap
peppercorn# mount -uw /mnt2
mount: /dev/md1: Read-only file system

Robert N M Watson


More information about the freebsd-bugs mailing list