Commit Graph

972 Commits

Author SHA1 Message Date
le
86733f6df7 When a drive dies, don't call g_wither_geom() directly, but instead
post an event to the geom event queue that will take care of it,
letting outstanding bios finish, and closing the consumers.

Plus some cosmetic clean ups.
2005-05-17 16:38:30 +00:00
pjd
0a798a236d cp can't be NULL.
Noticed by:	Coverity Prevent analysis tool
2005-05-11 19:36:56 +00:00
pjd
0e95eeadc2 gp can't be NULL.
Noticed by:	Coverity Prevent analysis tool
2005-05-11 19:35:43 +00:00
pjd
08790cba80 Add KASSERT() to be sure there is an active component.
Suggested by:	Coverity Prevent analysis tool
2005-05-11 18:13:51 +00:00
pjd
9d22b74b8f Check return value.
Found by:	Coverity Prevent analysis tool
2005-05-11 18:07:39 +00:00
nyan
123c83cc66 Fix signed vs unsigned warning. 2005-05-01 09:44:50 +00:00
le
3998514c39 Only allow RAID5 plexes to be parity checked.
PR:           kern/80427
Submitty by:  Stijn Hoop <stijn@win.tue.nl>
2005-04-28 13:09:00 +00:00
pjd
93f62be898 Fix provider's size check for 'insert' command.
Before this fix one was able to insert one sector too small provider.

MFC after:	3 days
2005-04-25 10:41:26 +00:00
wollman
bc5273fd8f The size of a filesystem may be less than the size of the provider it
resides on.  Fix the special case of the filesystem fragment size not
evenly dividing the size of the provider.  Fixing the general case
probably requires better superblock validation (left as an exercise to
the reader).
2005-04-19 21:55:28 +00:00
pjd
15eddd96be Remove the hack which allowed to use gmirror for root file system,
use root_mount KPI instead.
2005-04-19 21:47:25 +00:00
phk
ed5a7da798 Call g_waitidle() instead of GEOM using the root_mount_hold() KPI.
GEOM could (and will) get events as a result of drivers coming in
late so a one-shot method is not good enough for GEOM.
2005-04-19 06:23:59 +00:00
phk
b7f29c0fc0 Add a named reference-count KPI to hold off mounting of the root filesystem.
While we wait for holds to be released, print a list of who holds us
back once per second.

Use the new KPI from GEOM instead of vfs_mount.c calling g_waitidle().

Use the new KPI also from ata.

With ATAmkIII's newbusification, ata could narrowly miss the window
and ad0 would not exist when we tried to mount root.
2005-04-18 21:21:26 +00:00
pjd
c3333321cc Protect against recursive labels creation in simlar way as it is done
in BSD and MBR classes, ie. if provider below us uses the same metadata,
don't create labels based on the metadata.
This allows to create labels on geoms with rank != 1 without hacks.

Tested by:	Chris Elsworth <chris@shagged.org> on sparc64
OK'ed by:	phk
MFC after:	2 weeks
2005-04-12 08:14:15 +00:00
pjd
a2b6f80684 Fix a long-standing bug. Error string has to be copyied from the user
process context.

Approved by:	phk
MFC after:	3 days
2005-04-08 09:28:08 +00:00
pjd
ae7daf0c96 - Add a missing g_io_deliver() in case of allocation failure - we didn't
completed I/O requests here.
- First allocate all needed bios, so if any of allocations fail, we can
  free memory before sending any I/O requests down.

Reported by:	Pawel Malachowski
MFC after:	3 days
2005-04-03 14:55:49 +00:00
nyan
a855c5b2ce Remove geometry translations here. 2005-03-30 12:59:54 +00:00
joerg
a1f08bc5f7 Support VTOC volume names. This can be useful to distinguish multiple
disks in a system.  Solaris' format(1m) displays the volume names in
the disk overview.

MFC after:	1 month
2005-03-30 09:33:10 +00:00
phk
55543da1eb fix a "modify after free" bug which is practically impossible to
experience.

Found by:	Coverity (id #540 #541)
2005-03-26 21:07:35 +00:00
pjd
9129b5403c If an error occurs, clean up before returning from g_raid3_connect_disk(). 2005-03-26 17:24:19 +00:00
pjd
e13782ca35 Make the code more obvious - when an error occurs in g_mirror_connect_disk(),
detach and destroy consumer before returning.
2005-03-26 17:23:01 +00:00
pjd
90f14e00b7 Check for return values.
Submitted by:	sam
Found by:	Coverity Prevent analysis tool
2005-03-26 16:51:19 +00:00
phk
31aaa9f619 g_read_data() can return NULL, check for it.
Found by:	Coverity (ID#258)
2005-03-18 07:03:56 +00:00
phk
05ad105753 After rejecting the bio request early, return instead of panicing.
Found by:	Coverity (ID#450)
2005-03-18 07:01:31 +00:00
phk
aaa532d778 Avoid null pointer dereference. 2005-03-18 06:57:58 +00:00
pjd
84f16c193c Plug memory leak.
Submitted by:	Ted Unangst
Found by:	Coverity Prevent analysis tool
Approved by:	phk
MFC after:	3 days
2005-03-16 20:48:13 +00:00
phk
f6aaa7c4a4 forward declare struct disk. 2005-03-15 10:47:38 +00:00
phk
ddc0cb6817 Do not attach MBR on top of an MBR. This removes some confusing
slice names on disks with extended partitions.

Spotted on:	Mother-in-laws computer.
2005-03-14 15:22:18 +00:00
ume
73402ef817 stop including rijndael-api-fst.h from rijndael.h.
this is required to integrate opencrypto into crypto.
2005-03-11 15:42:51 +00:00
le
ee457df6ea Remove test for zero sectorsize when tasting. This check doesn't
seem to be necessary anymore, and it prevents tasting a valid drive
when booting with geom_vinum already loaded, since SCSI disks set their
sectorsize not until first opening them.
2005-03-07 19:58:58 +00:00
phk
18d1a64228 Add placeholder mutex argument to new_unrhdr(). 2005-03-07 11:05:47 +00:00
le
af31e4b0b5 Don't allow to synchronize a plex that is already sychronizing.
Reset the 'syncing' flag in case of errors, too.

Some cosmetics.
2005-03-04 16:43:40 +00:00
pjd
668a028670 - Add md_provsize field to metadata, which will help with
shared-last-sector problem.
  After this change, even if there is more than one provider with the same
  last sector, the proper one will be chosen based on its size.
  It still doesn't fix the 'c' partition problem (when da0s1 can be confused
  with da0s1c) and situation when 'a' partition starts at offset 0
  (then da0s1a can be confused with da0s1 and da0s1c). One can use '-h'
  option there, when creating device or avoid sharing last sector.
  Actually, when providers share the same last sector and their size is equal,
  they provide exactly the same data, so the name (da0s1, da0s1a, da0s1c)
  isn't important at all.
- Provide backward compatibility.
- Update copyright's year.

MFC after:	1 week
2005-02-27 23:07:47 +00:00
le
5722d64390 Correctly calculate what to do and how to retry a request to a plex when
the previous one failed and there are more than one plex in the volume.

This could have led to a flood of error messages on the console and
probably a deadlock in certain situations.
2005-02-23 14:59:14 +00:00
phk
66dfd63961 Try to unbreak the vnode locking around vop_reclaim() (based mostly on
patch from kan@).

Pull bufobj_invalbuf() out of vinvalbuf() and make g_vfs call it on
close.  This is not yet a generally safe function, but for this very
specific use it is safe.  This solves the problem with buffers not
being flushed by unmount or after failed mount attempts.
2005-02-19 11:44:57 +00:00
le
364c3f9996 In case of drive errors, don't close the associated consumer and
detach it, but instead let the geom wither away.

Bump copyright year.
2005-02-17 16:08:36 +00:00
pjd
1e033a07a4 Fix year in copyrights. 2005-02-16 22:26:34 +00:00
pjd
c05fe5379b Update copyright in files changed this year. 2005-02-16 22:14:52 +00:00
pjd
7d8dd193b1 Fix year in copyrights. 2005-02-16 22:13:22 +00:00
pjd
b83e0d6d3f Remove mutex asserion from g_gate_find(). We don't want g_gate_list_mtx
mutex to be held here, because we want speed here.
2005-02-16 16:13:56 +00:00
pjd
a0cee6bbb3 Remove TDP_GEOM flag from thread after ggate device creation.
This flag means "wait for all pending requests before returning to userland".
There are pending events for sure, because we just created new provider and
other classes want to taste it, but we cannot answer on I/O requests until
we're here.
2005-02-16 16:12:28 +00:00
pjd
a8be0605e4 Fix typo. We want to unlock mutex here.
Submitted by:	Andreas Kohn <andreas.kohn@gmail.com>
MFC after:	1 week
2005-02-12 16:19:03 +00:00
phk
67e4aa7d33 Make various random things static 2005-02-10 12:10:35 +00:00
pjd
c154250e86 - Remove g_gate_hold()/g_gate_release() from start/done paths. It saves
4 mutex operations per I/O requests.
- Use only one mutex to protect both (incoming and outgoing) queue.
  As MUTEX_PROFILING(9) shows, there is no big contention for this lock.
- Protect sc_queue_count with queue mutex, instead of doing atomic
  operations on it.
- Remove DROP_GIANT()/PICKUP_GIANT() - ggate is marked as MPSAFE and no
  Giant there.
2005-02-09 08:29:39 +00:00
des
80eee84ab5 merge from geom_vol_ffs.c rev 1.14 (avoid unaligned I/O requests) 2005-02-08 12:34:11 +00:00
des
4edf9621a3 Take care not to issue unaligned I/O requests while tasting a provider. 2005-02-08 08:04:23 +00:00
pjd
e4c6b83cfd - Use bioq_insert_tail()/bioq_insert_head() instead of bioq_disksort().
- Improve mediasize checking.

MFC after:	1 week
2005-02-05 00:30:08 +00:00
phk
1a5ece93a1 When dumping to a unpartitioned disk, make sure to chop the
length of the dump area accordingly.

Run into by:	scottl
2005-01-29 16:49:43 +00:00
jeff
83cae1af10 - If mpsafevfs is off, acquire giant around all calls to bufdone().
Sponsored by:   Isilon Systems, Inc.
2005-01-28 16:04:44 +00:00
phk
bb8d78bf44 Introduce and use g_vfs_close(). 2005-01-25 15:52:04 +00:00
phk
9e3a1e9a23 Create a correctly sized vnode objects for disk devices. 2005-01-24 22:41:21 +00:00