From owner-freebsd-bugs@FreeBSD.ORG Wed May 14 21:10:04 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C0DC106566C for ; Wed, 14 May 2008 21:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 005488FC16 for ; Wed, 14 May 2008 21:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m4ELA3Iq016888 for ; Wed, 14 May 2008 21:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m4ELA37o016887; Wed, 14 May 2008 21:10:03 GMT (envelope-from gnats) Date: Wed, 14 May 2008 21:10:03 GMT Message-Id: <200805142110.m4ELA37o016887@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Craig Rodrigues Cc: Subject: Re: kern/122833: [snapshots] [patch] mountd fails on nmount() after UFS snapshot creation with mount X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Craig Rodrigues List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2008 21:10:04 -0000 The following reply was made to PR kern/122833; it has been noted by GNATS. From: Craig Rodrigues To: Jaakko Heinonen Cc: bug-followup@FreeBSD.org, Ga??l Roualland , leon.kos@lecad.fs.uni-lj.si, rodrigc@FreeBSD.org, Yar Tikhiy Subject: Re: kern/122833: [snapshots] [patch] mountd fails on nmount() after UFS snapshot creation with mount Date: Wed, 14 May 2008 21:01:44 +0000 On Wed, May 14, 2008 at 06:56:40PM +0000, Craig Rodrigues wrote: > That fix is wrong. The better fix would be to come up > with a function that traverses a vfs_optlist and deletes a string > option from the list. Something like: Actually we have such a function. We need to do to the "snapshot" option what we do to the "export" option in sys/kern/vfs_export.c. Index: ffs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vfsops.c,v retrieving revision 1.340 diff -u -r1.340 ffs_vfsops.c --- ffs_vfsops.c 26 Mar 2008 20:48:07 -0000 1.340 +++ ffs_vfsops.c 14 May 2008 21:00:23 -0000 @@ -183,8 +183,15 @@ if (vfs_getopt(mp->mnt_optnew, "noclusterw", NULL, NULL) == 0) mntorflags |= MNT_NOCLUSTERW; - if (vfs_getopt(mp->mnt_optnew, "snapshot", NULL, NULL) == 0) + if (vfs_getopt(mp->mnt_optnew, "snapshot", NULL, NULL) == 0) { mntorflags |= MNT_SNAPSHOT; + /* + * Once we have set the MNT_SNAPSHOT flag, do not + * persist "snapshot" in the options list. + */ + vfs_deleteopt(mp->mnt_optnew, "snapshot"); + vfs_deleteopt(mp->mnt_opt, "snapshot"); + } MNT_ILOCK(mp); mp->mnt_flag = (mp->mnt_flag | mntorflags) & ~mntandnotflags; -- Craig Rodrigues rodrigc@crodrigues.org