diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2008-05-24 00:41:32 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2008-05-24 00:41:32 +0000 |
commit | c1896c3fec74e2013c5853780ce195f9db29707a (patch) | |
tree | 3c7889a01c3e59f3f86cd6c8f9cc28c741a9563f /sys/ufs/ffs/ffs_vfsops.c | |
parent | 44e2059da21861a842a7dfa51051fbe886d2ff57 (diff) | |
download | FreeBSD-src-c1896c3fec74e2013c5853780ce195f9db29707a.zip FreeBSD-src-c1896c3fec74e2013c5853780ce195f9db29707a.tar.gz |
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 <leon.kos lecad fs uni-lj si>,
Jaakko Heinonen <jh saunalahti fi>
MFC after: 1 month
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 9 |
1 files changed, 8 insertions, 1 deletions
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; |