diff options
-rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 10 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_vfsops.c | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 73a5bce..5d7ff1b 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -156,7 +156,17 @@ iso_mountroot(mp, td) return (error); } args.flags = ISOFSMNT_ROOT; + + vn_lock(rootvp, LK_EXCLUSIVE | LK_RETRY, td); + error = VOP_OPEN(rootvp, FREAD, FSCRED, td); + VOP_UNLOCK(rootvp, 0, td); + if (error) + return error; + args.ssector = iso_get_ssector(rootdev, td); + + (void)VOP_CLOSE(rootvp, FREAD, NOCRED, td); + if (bootverbose) printf("iso_mountroot(): using session at block %d\n", args.ssector); diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index 73a5bce..5d7ff1b 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -156,7 +156,17 @@ iso_mountroot(mp, td) return (error); } args.flags = ISOFSMNT_ROOT; + + vn_lock(rootvp, LK_EXCLUSIVE | LK_RETRY, td); + error = VOP_OPEN(rootvp, FREAD, FSCRED, td); + VOP_UNLOCK(rootvp, 0, td); + if (error) + return error; + args.ssector = iso_get_ssector(rootdev, td); + + (void)VOP_CLOSE(rootvp, FREAD, NOCRED, td); + if (bootverbose) printf("iso_mountroot(): using session at block %d\n", args.ssector); |