From c1896c3fec74e2013c5853780ce195f9db29707a Mon Sep 17 00:00:00 2001 From: rodrigc Date: Sat, 24 May 2008 00:41:32 +0000 Subject: After converting the "snapshot" mount option to the MNT_SNAPSHOT flag, delete "snapshot" from the persistent mount options list. This should fix problems with doing a mount -o snapshot of a file system, followed by an NFS export of the same file system. PR: 122833 Reported by: Leon Kos , Jaakko Heinonen MFC after: 1 month --- sys/ufs/ffs/ffs_vfsops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sys/ufs/ffs') diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 448b817..1b746f6 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -162,8 +162,15 @@ ffs_mount(struct mount *mp, struct thread *td) if (vfs_getopt(mp->mnt_optnew, "acls", NULL, NULL) == 0) mntorflags |= MNT_ACLS; - 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; -- cgit v1.1