Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jun 2004 12:05:04 -0700 (PDT)
From:      John Kozubik <john@kozubik.com>
To:        freebsd-hackers@freebsd.org
Subject:   writing to RW-mounted UFS2 snapshots - confirmed.
Message-ID:  <20040630115340.L806-100000@kozubik.com>

next in thread | raw e-mail | index | archive | help

It was mentioned earlier this week that UFS2 snapshots could somehow be
mounted read/write and then written to.  I noticed this a few weeks ago
but didn't think much of it.

I have reproduced this:

mksnap_ffs / /snap1
mkdir /snapmount
mdconfig -a -t vnode -f /snap1 -u 4
mount -r /dev/md4 /snapmount

So far so good ... now enter the mounted snapshot and attempt to write a
file:

# cd /snapmount/
# touch test
touch: test: Read-only file system
#

This is the expected behavior.  However:

#
# pwd
/snapmount
# mount -uw /snapmount
# touch test
# echo sldkfslk >> /snapmount/test
#
# cat /snapmount/test
sldkfslk
#

This is unexpected.  You can successfully mount the snapshot read/write
and create and write to files in that snapshot.  You can also write to
files that existed in the snapshot prior to mounting it read/write.

I have confirmed that if you unmount the snapshot and remount it again
normally, the created file(s) still exist in it, and any changes made to
existing files in the snapshot are persistent as well.

I don't know what context this was being discussed in, but this behavior
does indeed exist, and I believe it to be a somewhat serious problem.


-----
John Kozubik - john@kozubik.com - http://www.kozubik.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040630115340.L806-100000>