Date: Wed, 14 May 2008 19:00:15 GMT From: Craig Rodrigues <rodrigc@crodrigues.org> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/122833: [snapshots] [patch] mountd fails on nmount() after UFS snapshot creation with mount Message-ID: <200805141900.m4EJ0FaQ004608@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/122833; it has been noted by GNATS. From: Craig Rodrigues <rodrigc@crodrigues.org> To: Jaakko Heinonen <jh@saunalahti.fi> Cc: bug-followup@FreeBSD.org, Ga??l Roualland <gael.roualland@dial.oleane.com>, leon.kos@lecad.fs.uni-lj.si, rodrigc@FreeBSD.org, Yar Tikhiy <yar@comp.chem.msu.su> Subject: Re: kern/122833: [snapshots] [patch] mountd fails on nmount() after UFS snapshot creation with mount Date: Wed, 14 May 2008 18:56:40 +0000 On Wed, May 14, 2008 at 11:18:52AM +0300, Jaakko Heinonen wrote: > Following change is a possible quick fix for the bug: > > Index: ffs_vfsops.c > =================================================================== > RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vfsops.c,v > retrieving revision 1.336 > diff -p -u -r1.336 ffs_vfsops.c > --- ffs_vfsops.c 24 Feb 2008 16:38:58 -0000 1.336 > +++ ffs_vfsops.c 13 May 2008 17:08:20 -0000 > @@ -183,9 +183,6 @@ ffs_mount(struct mount *mp, struct threa > if (vfs_getopt(mp->mnt_optnew, "noclusterw", NULL, NULL) == 0) > mntorflags |= MNT_NOCLUSTERW; > > - if (vfs_getopt(mp->mnt_optnew, "snapshot", NULL, NULL) == 0) > - mntorflags |= MNT_SNAPSHOT; > - > MNT_ILOCK(mp); > mp->mnt_flag = (mp->mnt_flag | mntorflags) & ~mntandnotflags; > MNT_IUNLOCK(mp); 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: int vfs_delopt(struct vfsoptlist *optlist, const char *optname); Then the above code would change to: if (vfs_getopt(mp->mnt_optnew, "snapshot", NULL, NULL) == 0) { mntorflags |= MNT_SNAPSHOT; vfs_delopt(mp->optnew, "snapshot"); } -- Craig Rodrigues rodrigc@crodrigues.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805141900.m4EJ0FaQ004608>