From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 30 19:06:22 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53EDD16A4CE for ; Wed, 30 Jun 2004 19:06:22 +0000 (GMT) Received: from kozubik.com (kozubik.com [65.248.2.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B77743D55 for ; Wed, 30 Jun 2004 19:06:22 +0000 (GMT) (envelope-from john@kozubik.com) Received: from kozubik.com (john@localhost [IPv6:::1]) by kozubik.com (8.12.3/8.12.3) with ESMTP id i5UJ54Bx034334 for ; Wed, 30 Jun 2004 12:05:04 -0700 (PDT) (envelope-from john@kozubik.com) Received: from localhost (john@localhost) by kozubik.com (8.12.3/8.12.3/Submit) with ESMTP id i5UJ54KT034331 for ; Wed, 30 Jun 2004 12:05:04 -0700 (PDT) Date: Wed, 30 Jun 2004 12:05:04 -0700 (PDT) From: John Kozubik To: freebsd-hackers@freebsd.org Message-ID: <20040630115340.L806-100000@kozubik.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: writing to RW-mounted UFS2 snapshots - confirmed. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2004 19:06:22 -0000 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