Commit Graph

980 Commits

Author SHA1 Message Date
Yoshihiro Takahashi
0bf2708b8c Merged from geom_mbr.c revisions 1.62 and 1.66.
- Implement a gctl handler and the verb "write MBR".
2005-07-15 15:29:45 +00:00
Lukas Ertl
7ad68986b8 *) Implement round-robin reads for multiplex volumes.
*) Plug a possible memory leak. [1]

[1] obtained from: pjd@.
2005-07-15 13:38:06 +00:00
Poul-Henning Kamp
1c3cf26412 Implement a gctl handler and the verb "write MBR" which can be used to
update metadata and bootcode while the MBR is in use.

MFC candidate
2005-07-15 08:00:44 +00:00
Pawel Jakub Dawidek
84436f14c4 Add CANCEL command which allows to remove one request from the queue or
all requests from the queue if request number is not given.

Bump version number.

Approved by:	re (scottl)
2005-07-08 21:08:53 +00:00
Pawel Jakub Dawidek
59ddf345d5 After provider creation!! 2005-05-25 15:54:17 +00:00
Pawel Jakub Dawidek
0f2bbe5ba4 - Call root_mount_rel() when provider IS created, not earlier.
This should close the race observed by Daniel Eriksson.
- Remove redundant wakeup().
2005-05-25 13:10:04 +00:00
Pawel Jakub Dawidek
4eafb037f6 Add some debug code to diagnose root-on-mirror problems with recent -current.
Reported by:	Daniel Eriksson
2005-05-23 13:05:07 +00:00
Pawel Jakub Dawidek
d246aa55e7 Correct typo. 2005-05-18 21:53:08 +00:00
Lukas Ertl
0164489c96 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
Pawel Jakub Dawidek
3ac6c13bd4 cp can't be NULL.
Noticed by:	Coverity Prevent analysis tool
2005-05-11 19:36:56 +00:00
Pawel Jakub Dawidek
b957751627 gp can't be NULL.
Noticed by:	Coverity Prevent analysis tool
2005-05-11 19:35:43 +00:00
Pawel Jakub Dawidek
862f5624ea Add KASSERT() to be sure there is an active component.
Suggested by:	Coverity Prevent analysis tool
2005-05-11 18:13:51 +00:00
Pawel Jakub Dawidek
0a3384a8f8 Check return value.
Found by:	Coverity Prevent analysis tool
2005-05-11 18:07:39 +00:00
Yoshihiro Takahashi
16da54931e Fix signed vs unsigned warning. 2005-05-01 09:44:50 +00:00
Lukas Ertl
bc2d4d6784 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
Pawel Jakub Dawidek
3865ca2e13 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
Garrett Wollman
d5e3d722df 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
Pawel Jakub Dawidek
7979b3683c 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
Poul-Henning Kamp
d1c712ede2 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
Poul-Henning Kamp
73fbaa74e5 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
Pawel Jakub Dawidek
811787079b 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
Pawel Jakub Dawidek
cdae843174 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
Pawel Jakub Dawidek
7e0b3120e7 - 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
Yoshihiro Takahashi
612f970e46 Remove geometry translations here. 2005-03-30 12:59:54 +00:00
Joerg Wunsch
3328bbeef2 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
Poul-Henning Kamp
9bb329f4e5 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
Pawel Jakub Dawidek
34cb151796 If an error occurs, clean up before returning from g_raid3_connect_disk(). 2005-03-26 17:24:19 +00:00
Pawel Jakub Dawidek
c2ca10933d 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
Pawel Jakub Dawidek
cc6aa917b9 Check for return values.
Submitted by:	sam
Found by:	Coverity Prevent analysis tool
2005-03-26 16:51:19 +00:00
Poul-Henning Kamp
cb7ff8b71d g_read_data() can return NULL, check for it.
Found by:	Coverity (ID#258)
2005-03-18 07:03:56 +00:00
Poul-Henning Kamp
b3fd9b46bb After rejecting the bio request early, return instead of panicing.
Found by:	Coverity (ID#450)
2005-03-18 07:01:31 +00:00
Poul-Henning Kamp
b3b21113a5 Avoid null pointer dereference. 2005-03-18 06:57:58 +00:00
Pawel Jakub Dawidek
42cfb5bada 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
Poul-Henning Kamp
20b3501394 forward declare struct disk. 2005-03-15 10:47:38 +00:00
Poul-Henning Kamp
03c02e5cb1 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
Hajimu UMEMOTO
68527b3aad 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
Lukas Ertl
cf01c54cda 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
Poul-Henning Kamp
3b3f38ed7d Add placeholder mutex argument to new_unrhdr(). 2005-03-07 11:05:47 +00:00
Lukas Ertl
9954331c23 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
Pawel Jakub Dawidek
e68909854c - 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
Lukas Ertl
d8688e1117 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
Poul-Henning Kamp
dfd4be14bd 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
Lukas Ertl
3608f72533 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
Pawel Jakub Dawidek
07b9f1becd Fix year in copyrights. 2005-02-16 22:26:34 +00:00
Pawel Jakub Dawidek
0218292cdf Update copyright in files changed this year. 2005-02-16 22:14:52 +00:00
Pawel Jakub Dawidek
99394c59ae Fix year in copyrights. 2005-02-16 22:13:22 +00:00
Pawel Jakub Dawidek
ccbef85dd0 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
Pawel Jakub Dawidek
f906581296 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
Pawel Jakub Dawidek
35f855d9f9 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
Poul-Henning Kamp
07e95ed633 Make various random things static 2005-02-10 12:10:35 +00:00