diff options
| author | oster <oster@NetBSD.org> | 2021-08-28 16:00:52 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2021-08-28 16:00:52 +0000 |
| commit | adc0a73edecf306452e9c8f414c4549130823af9 (patch) | |
| tree | 8aaf5c50042969bbd42d6881d83f38a157185976 /sys/dev/raidframe | |
| parent | 2ce5820ead2cea575ab03af1815dccdf0be5c0c9 (diff) | |
If there is a FS_RAID partition on a disk, then we shouldn't look at
the raw partition. In particular, we now need to account for the case
where an existing FS_RAID partition is now open because it is in use.
If that is the case, we don't look at the raw partition.
Addresses PR kern/56369.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 3c7cc24ae61..3be5cbbab19 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.399 2021/08/07 16:19:15 thorpej Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.400 2021/08/28 16:00:52 oster Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.399 2021/08/07 16:19:15 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.400 2021/08/28 16:00:52 oster Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_autoconfig.h" @@ -3040,7 +3040,19 @@ rf_find_raid_components(void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = VOP_OPEN(vp, FREAD, NOCRED); if (error) { - /* Whatever... */ + /* Not quite a 'whatever'. In + * this situation we know + * there is a FS_RAID + * partition, but we can't + * open it. The most likely + * reason is that the + * partition is already in + * use by another RAID set. + * So note that we've already + * found a partition on this + * disk so we don't attempt + * to use the raw disk later. */ + rf_part_found = 1; vput(vp); continue; } |
