| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ext2fs_vfsops.c,v 1.137.6.1 2008/11/29 23:10:19 snj Exp $ */ | | 1 | /* $NetBSD: ext2fs_vfsops.c,v 1.137.6.2 2009/10/16 05:48:48 snj Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1989, 1991, 1993, 1994 | | 4 | * Copyright (c) 1989, 1991, 1993, 1994 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -55,27 +55,27 @@ | | | @@ -55,27 +55,27 @@ |
55 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 55 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
56 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 56 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
57 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 57 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
58 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 58 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
59 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 59 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
60 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 60 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
61 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 61 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
62 | * | | 62 | * |
63 | * @(#)ffs_vfsops.c 8.14 (Berkeley) 11/28/94 | | 63 | * @(#)ffs_vfsops.c 8.14 (Berkeley) 11/28/94 |
64 | * Modified for ext2fs by Manuel Bouyer. | | 64 | * Modified for ext2fs by Manuel Bouyer. |
65 | */ | | 65 | */ |
66 | | | 66 | |
67 | #include <sys/cdefs.h> | | 67 | #include <sys/cdefs.h> |
68 | __KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.137.6.1 2008/11/29 23:10:19 snj Exp $"); | | 68 | __KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.137.6.2 2009/10/16 05:48:48 snj Exp $"); |
69 | | | 69 | |
70 | #if defined(_KERNEL_OPT) | | 70 | #if defined(_KERNEL_OPT) |
71 | #include "opt_compat_netbsd.h" | | 71 | #include "opt_compat_netbsd.h" |
72 | #endif | | 72 | #endif |
73 | | | 73 | |
74 | #include <sys/param.h> | | 74 | #include <sys/param.h> |
75 | #include <sys/systm.h> | | 75 | #include <sys/systm.h> |
76 | #include <sys/sysctl.h> | | 76 | #include <sys/sysctl.h> |
77 | #include <sys/namei.h> | | 77 | #include <sys/namei.h> |
78 | #include <sys/proc.h> | | 78 | #include <sys/proc.h> |
79 | #include <sys/kernel.h> | | 79 | #include <sys/kernel.h> |
80 | #include <sys/vnode.h> | | 80 | #include <sys/vnode.h> |
81 | #include <sys/socket.h> | | 81 | #include <sys/socket.h> |
| @@ -352,28 +352,35 @@ ext2fs_mount(struct mount *mp, const cha | | | @@ -352,28 +352,35 @@ ext2fs_mount(struct mount *mp, const cha |
352 | /* | | 352 | /* |
353 | * Be sure this is a valid block device | | 353 | * Be sure this is a valid block device |
354 | */ | | 354 | */ |
355 | if (devvp->v_type != VBLK) | | 355 | if (devvp->v_type != VBLK) |
356 | error = ENOTBLK; | | 356 | error = ENOTBLK; |
357 | else if (bdevsw_lookup(devvp->v_rdev) == NULL) | | 357 | else if (bdevsw_lookup(devvp->v_rdev) == NULL) |
358 | error = ENXIO; | | 358 | error = ENXIO; |
359 | } else { | | 359 | } else { |
360 | /* | | 360 | /* |
361 | * Be sure we're still naming the same device | | 361 | * Be sure we're still naming the same device |
362 | * used for our initial mount | | 362 | * used for our initial mount |
363 | */ | | 363 | */ |
364 | ump = VFSTOUFS(mp); | | 364 | ump = VFSTOUFS(mp); |
365 | if (devvp != ump->um_devvp) | | 365 | if (devvp != ump->um_devvp) { |
366 | error = EINVAL; | | 366 | if (devvp->v_rdev != ump->um_devvp->v_rdev) |
| | | 367 | error = EINVAL; |
| | | 368 | else { |
| | | 369 | vrele(devvp); |
| | | 370 | devvp = ump->um_devvp; |
| | | 371 | vref(devvp); |
| | | 372 | } |
| | | 373 | } |
367 | } | | 374 | } |
368 | } else { | | 375 | } else { |
369 | if (!update) { | | 376 | if (!update) { |
370 | /* New mounts must have a filename for the device */ | | 377 | /* New mounts must have a filename for the device */ |
371 | return (EINVAL); | | 378 | return (EINVAL); |
372 | } else { | | 379 | } else { |
373 | ump = VFSTOUFS(mp); | | 380 | ump = VFSTOUFS(mp); |
374 | devvp = ump->um_devvp; | | 381 | devvp = ump->um_devvp; |
375 | vref(devvp); | | 382 | vref(devvp); |
376 | } | | 383 | } |
377 | } | | 384 | } |
378 | | | 385 | |
379 | /* | | 386 | /* |