From owner-freebsd-current@FreeBSD.ORG Wed Dec 5 10:14:30 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C30822F2 for ; Wed, 5 Dec 2012 10:14:30 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [IPv6:2001:5a8:4:7e72:4a5b:39ff:fe12:452]) by mx1.freebsd.org (Postfix) with ESMTP id 575AC8FC0C for ; Wed, 5 Dec 2012 10:14:27 +0000 (UTC) Received: from chez.mckusick.com (localhost [127.0.0.1]) by chez.mckusick.com (8.14.3/8.14.3) with ESMTP id qB5AEPQP054949; Wed, 5 Dec 2012 02:14:25 -0800 (PST) (envelope-from mckusick@chez.mckusick.com) Message-Id: <201212051014.qB5AEPQP054949@chez.mckusick.com> To: HATANO Tomomi Subject: Re: SU+J on 9.1-RC2 ISO In-reply-to: <20121104.211336.244701604.hatanou@infolab.ne.jp> Date: Wed, 05 Dec 2012 02:14:25 -0800 From: Kirk McKusick X-Spam-Status: No, score=0.0 required=5.0 tests=MISSING_MID, UNPARSEABLE_RELAY autolearn=failed version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on chez.mckusick.com X-Mailman-Approved-At: Wed, 05 Dec 2012 12:46:44 +0000 Cc: jdc@koitsu.org, b.smeelen@ose.nl, fnwhitehorn@freebsd.org, freebsd-current@freebsd.org, Jeff Roberson X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Dec 2012 10:14:30 -0000 > Date: Sun, 04 Nov 2012 21:13:36 +0900 (JST) > To: freebsd-stable@freebsd.org > Subject: Re: SU+J on 9.1-RC2 ISO > From: HATANO Tomomi > Cc: jdc@koitsu.org, b.smeelen@ose.nl, fnwhitehorn@freebsd.org, > freebsd-current@freebsd.org > > Hi all. > > The point is: > > There is completely no way to take a snapshot of SU+J partition > unless modify one's kernel. > > Whether some issue still exist or not, > how about enabling snapshoting SU+J partition > through sysctl variable? > > Would you mind to see patch attached? > > 1. Taking a snapshot of SU+J partition is controlled through sysctl variable. > > 2. Default to disable. > One who want to enable it should set the variable manually. > > 3. The default value in bsdinstall(8) may be left as is. > -- > HATANO Tomomi. > > --- src/sys/ufs/ffs/ffs_snapshot.c.orig 2012-11-04 11:01:58.000000000 +0900 > +++ src/sys/ufs/ffs/ffs_snapshot.c 2012-11-04 11:13:32.000000000 +0900 > @@ -182,8 +182,10 @@ > */ > int dopersistence = 0; > > -#ifdef DEBUG > #include > +int snapsuj = 0; > +SYSCTL_INT(_debug, OID_AUTO, snapsuj, CTLFLAG_RW, &snapsuj, 0, ""); > +#ifdef DEBUG > SYSCTL_INT(_debug, OID_AUTO, dopersistence, CTLFLAG_RW, &dopersistence, 0, ""); > static int snapdebug = 0; > SYSCTL_INT(_debug, OID_AUTO, snapdebug, CTLFLAG_RW, &snapdebug, 0, ""); > @@ -230,7 +232,7 @@ > * At the moment, journaled soft updates cannot support > * taking snapshots. > */ > - if (MOUNTEDSUJ(mp)) { > + if (MOUNTEDSUJ(mp) && (snapsuj == 0)) { > vfs_mount_error(mp, "%s: Snapshots are not yet supported when " > "running with journaled soft updates", fs->fs_fsmnt); > return (EOPNOTSUPP); > Snapshots are disabled when using SU+J for a reason. That reason is that the journal rollback when a snapshot is active on a filesystem DOES NOT WORK. It leaves your filesystem with duplicate blocks that can only be removed by manually running fsck and correcting the duplicate block entries by hand. If you need to use snapshots, then run with SU and not SU+J. When journal rollback properly handles snapshots, snapshots on SU+J will be enabled. Kirk McKusick