Commit Graph

972 Commits

Author SHA1 Message Date
pjd
b9bb54bcb8 If device is marked as beeing destroyed, deny all access requests. 2004-11-08 20:23:53 +00:00
pjd
d62be2e0d6 Don't forget to make sure that there are no not-finished requests before
marking components as clean.

Pointed out by:	scottl
2004-11-05 17:18:39 +00:00
pjd
b004592010 - Mark all raid3 components as clean after kern.geom.raid3.idletime seconds.
- Make kern.geom.raid3.timeout variable tunable.
2004-11-05 13:12:58 +00:00
pjd
f229109eb7 Mark raid3 devices as clean on shutdown (after all file systems are
unmounted).

Suggested by:	scottl
2004-11-05 13:01:25 +00:00
pjd
270f218c1d - Use ->index consumer's field to track number of in-flight requests.
- Remove unused #include.
2004-11-05 12:42:16 +00:00
pjd
268c658b69 Use shutdown hooks to mark mirrors as clean after all file systems are
unmounted.

Suggested by:	scottl
2004-11-05 12:35:21 +00:00
pjd
de4e5b4e88 Remove unused #include. 2004-11-05 12:31:32 +00:00
pjd
0bd7b4d36a - Add a sysctl kern.geom.mirror.idletime, so one can specify after how many
seconds of idling, DRITY flags are removed.
- If mirror is in idle state or is not open for writing, sleep without
  timeout when waiting for I/O requests.
- Don't use atomic operations, for now sysctls are protected by Giant.
- Update debugs.
2004-11-05 10:55:04 +00:00
pjd
d0890a743f MFp4:
- Fix for good (I hope) force-stopping mirrors and some filure cases
  (e.g. the last good component dies when synchronization is in progress).
  Don't use ->nstart/->nend consumer's fields, as this could be racy,
  because those fields are used in g_down/g_up, use ->index consumer's
  field instead for tracking number of not finished requests.

  Reported by:	marcel

- After 5 seconds of idle time (this should be configurable) mark all
  dirty providers as clean, so when mirror is not used in 5 seconds
  and there will be power failure, no synchronization on boot is needed.

  Idea from:	sorry, I can't find who suggested this

- When there are no ACTIVE components and no NEW components destroy whole
  mirror, not only provider.

- Fix one debug to show information about I/O request, before we change
  its command.
2004-11-05 09:05:15 +00:00
phk
95abc5d4fd Finish cut&paste adjustments.
Spotted by:	tegge
2004-11-04 07:17:08 +00:00
phk
f31ec96a3e Stop dumping the MBR entries under bootverbose 2004-11-03 09:08:33 +00:00
phk
cc263b9934 Stop wasting a bootverbose line on all geom slices. 2004-11-03 09:08:10 +00:00
phk
6358ee90d6 Don't set si_bsize_phys, nobody cares. 2004-10-29 11:11:44 +00:00
phk
f0dd76e153 Add GEOM class "VFS" for filesystems and other buffer cache users
of GEOM devices.

There is nothing magic about this, it just gives a bufobj interface
to GEOM.
2004-10-29 09:56:56 +00:00
phk
269b7a298a Add g_wither_geom_close() function. 2004-10-29 09:19:03 +00:00
phk
86cc21c765 Give dev_strategy() an explict cdev argument in preparation for removing
buf->b-dev.

Put a bio between the buf passed to dev_strategy() and the device driver
strategy routine in order to not clobber fields in the buf.

Assert copyright on vfs_bio.c and update copyright message to canonical
text.  There is no legal difference between John Dysons two-clause
abbreviated BSD license and the canonical text.
2004-10-29 07:16:37 +00:00
le
d0679d2fde Give each plex a separate queue where held back bios are put on.
This lowers the CPU usage of the worker thread and prevents a
possible live lock on non-SMP machines.

MFC candidate.
2004-10-26 21:01:42 +00:00
phk
fc5bad60e3 Use unit number allocation functions for GEOM minor numbers. 2004-10-25 12:28:28 +00:00
phk
5065a91152 Retire si_stripesize and si_stripeoffset they will not be needed in cdev
in the future.
2004-10-25 07:40:54 +00:00
phk
80dc3e1bc2 Don't call g_waitidle(), it happens automagically now. 2004-10-23 20:52:15 +00:00
phk
93429f2778 Add a new per-thread private flag: TDP_GEOM.
This flag gets set whenever the thread posts an event on the GEOM
event queue, and if the flag is set when the thread is prepared
to return to userland from the kernel, g_waitidle() will be called
to make sure that the posted events have completed.

This can replace an insufficient number of g_waitidle() calls in
various other places, and has the advantage of being failsafe:  Any
system call which does a VOP_OPEN()/VOP_CLOSE will now correctly
wait for any geom events it posted as part of spoils or tastes.

Assert that topology and Giant is not held in g_waitidle().
2004-10-23 20:49:17 +00:00
phk
00ae1b0f02 Move the prototype for g_waitidle() to a more visible place. 2004-10-23 20:22:02 +00:00
arr
b510c7b809 - Turn KASSERT()s into warning printf()'s in the g_class_load() routine.
This removes a panic that will occur if you build with GENERIC and
  attempt to kldload a GEOM module that is already in the kernel.

Reviewed by: phk
2004-10-22 22:16:24 +00:00
rwatson
6a5cd72bf3 Add KTR_GEOM, which allows tracing of basic GEOM I/O events occuring
in the g_up and g_down threads.  Each time a bio is propelled up and
down the stack, an event is generating showing the provider, offset,
and length, as well as thread wakeup and work status information.
2004-10-21 18:35:24 +00:00
pjd
ae8741cdf4 Ehh. Introduce a hack: Wait for 3 seconds, so GEOM is able to give us
providers for tasting. Before this hack, race below is possible:
	SI_SUB_RAID (no not-fully-configured geoms, so don't block)
	GEOM tasting (now geoms are created)
	SI_SUB_MOUNT_ROOT (if root file system is placed on a mirror, it is
		possible that this mirror is not fully configured yet)
There is a lot of work to do to avoid such hacks and I need a working
solution before 5.3, sorry.

Reported by:	John Hay <jhay@icomtek.csir.co.za>
2004-10-14 07:55:29 +00:00
pjd
c06dbb0415 Only allow for unloading when there are no geoms in LABEL GEOM class.
We have to use our own destroy_geom method, because default one, which
is a part of geom_slice is broken.
MT5 candidate.

PR:		kern/72467
Submitted by:	Vladimir Novoseltsev
2004-10-14 07:46:13 +00:00
green
c125751bac When loading GEOM modules, we expect the actual load process to be done
by the time that kldload(8) returns.  Satisfy that by making the GEOM
module load event -- only when the kernel is !cold -- wait until the
GEOM module init function has finished instead of returning immediately.

This is the other half of fixing md(8) (actually, "mfs" in fstab(5))
that is similar to r1.128 of src/sys/dev/md/md.c.  This bug would be
why RAM disks would often fail on boot and the first call to mdconfig(8)
would probably fail.

pjd has ideas for not requiring kldload(8) to work synchronously for
control devices that could make this obsolete.

Silence on:	-arch
2004-10-12 04:44:54 +00:00
ups
9d97668203 Trace information about a buffer while we still control it.
Reviewed by:    phk
Approved by:    sam (mentor)
2004-10-11 21:22:59 +00:00
sos
49fc63d1c8 Only do the geometry translations on ad* devices, other devices seems to
have their own way of life.
Those other devices translations should be moved here as well.
2004-10-08 21:27:27 +00:00
pjd
8ad6178d29 Be sure to always return 0 for negative access requests.
Reported by:	Maciej Kucharz <qk@comp.waw.pl>
2004-10-07 20:13:23 +00:00
sos
058a8fa0b8 Move the PC98 specific geometry "gunk" to geom_pc98.c where it belongs.
This also adds support for bigger disks on the controller I have access to,
and maybe others if I understood the adhoc methods used on those.

Those with more PC98 bigdrive controllers it is hereby invited to add/fix
support for those in geom_pc98.c and not using #ifdef PC98 all over the place.
2004-10-07 17:37:09 +00:00
phk
c6a0a9edbf Don't set the BIO_ONQUEUE debugging flag until we actually put the bio
onto a queue.  This made the ENOMEM handling an instant panic.
2004-10-06 20:59:59 +00:00
pjd
49a5dba557 Geoms without softc are geoms which are initialized, so wait for them. 2004-10-06 18:47:15 +00:00
pjd
66f574f537 Look out for geoms without softc.
Reported by:	tegge
2004-10-06 14:15:47 +00:00
pjd
3f28bf167b Before root file system is mounted, wait for mirrors in degraded state. 2004-10-05 11:17:08 +00:00
le
58075b5ab9 Don't allow to create a drive that already exists. 2004-10-02 20:50:21 +00:00
le
8ff45b1742 Correctly skip the '/dev/' part when creating new drives and prefix
a drive's provider with '/dev/' when printing the config.

Reported by:  will@
2004-10-02 20:12:20 +00:00
pjd
06c0f5f487 Unlock g_gate_list_mtx mutex when we cannot allocate unit number.
MT5 candidate.

PR:		kern/72253
Submitted by:	Ivan Voras <ivoras@fer.hr>
2004-10-02 15:03:26 +00:00
le
ada7c51edc Make it possible to rebuild degraded RAID5 plexes. Note that it is
currently not possible to do this while the volume is mounted.

MFC in:  1 week
2004-09-30 12:57:35 +00:00
phk
dd7446483c Protect the start/end counts on consumers and providers with the up/down
mutexes.

Make it possible to also protect the disk statistics (at a minor cost in
performance) by setting bit 2 of kern.geom.collectstats.
2004-09-28 11:56:37 +00:00
pjd
5b9c332a3c - Set maximum request size to MAXPHYS (128kB), instead of DFLPHYS (64kB).
- Set minimum request size to sectorsize, instead of 512 bytes.

Approved by:	phk (some time ago)
2004-09-28 08:34:27 +00:00
pjd
63dd0f756b Just use MAXPHYS as maximum I/O request size, instead of using my own
#define for this purpose.
No functional change.
2004-09-28 07:33:37 +00:00
pjd
ef6747fa18 Decrease kern.geom.raid3.timeout to 4, so it is smaller than
vfs.root.mountdelay by default.
2004-09-27 22:12:14 +00:00
pjd
25b7bcde0d Deny invalid I/O requests which comes from userland here, because later
we'll get a panic.
MT5 candidate.

Reviewed by:	phk
2004-09-27 22:10:01 +00:00
pjd
34196975cf Avoid race while synchronizing components. It is very hard to bump into,
but it is possible:
1. Read data from good component for synchronization.
2. Write data to the same area.
3. Write synchronization data, which are now stale.

Found by:	tegge (for gmirror)
2004-09-27 20:32:35 +00:00
pjd
cad6af1c8f Minor, but very important condition fix. The current one can never be true. 2004-09-27 19:32:26 +00:00
pjd
4081d9d5d1 Decrease kern.geom.mirror.timeout to 4, so it is smaller than
vfs.root.mountdelay by default.
2004-09-27 13:47:37 +00:00
pjd
9b6a1c588a Forgot to commit addition of ds_resync field. 2004-09-26 20:42:35 +00:00
pjd
9871848b34 Avoid race while synchronizing components. It is very hard to bump into,
but it is possible:
1. Read data from good component for synchronization.
2. Write data to the same area.
3. Write synchronization data, which are now stale.

Found by:	tegge
2004-09-26 20:41:07 +00:00
pjd
48183ebbc3 Simplify code a bit. 2004-09-26 20:30:15 +00:00
phk
54ba36ef3e Assert topology is held in g_dev_getprovider().
Don't call devsw().  It is not necessary, and we do not need to hold dev_lock
to compare the devsw pointer to our own since we do not dereference it.
2004-09-24 06:43:20 +00:00
pjd
d7954bf77f This is not needed anymore, it is forced in GEOM now.
Actually, it can even cause some problems, because GEOM requires sectorsize
to be more than 0 on first access, not on provider creation, so we can skip
valid providers by doing this check here.

Reported by:	Divacky Roman <xdivac02@stud.fit.vutbr.cz>
		Sven Willenberger <sven@dmv.com>
2004-09-20 17:26:25 +00:00
fjoe
2a220bb5b0 Use correct malloc type when freeing memory allocated by g_read_data.
PR:		71431
Submitted by:	daichi
2004-09-19 10:27:46 +00:00
le
5dae52591b Single concat or striped plexes don't need no special initialization
if their subdisks are all available, so let them be brought up.
2004-09-18 18:03:20 +00:00
le
18ba8315a7 Re-vamp how I/O is handled in volumes and plexes.
Analogous to the drive level, give each volume and plex a worker thread
that picks up and processes incoming and completed BIOs.

This should fix the data corruption issues that have come up a few
weeks ago and improve performance, especially of RAID5 plexes.

The volume level needs a little work, though.
2004-09-18 13:44:43 +00:00
fjoe
76d2723d97 g_nop_create: destroy newly created provider in case of errors. 2004-09-16 15:28:48 +00:00
le
eb087a4ece Give the DRIVE geom a worker thread that picks up incoming bios,
sends them down, and takes care of the finished bios.  This makes it
easier to handle I/O errors at drive level.
2004-09-13 21:01:36 +00:00
le
a4de4268bd Rename gv_kill_thread() to gv_kill_plex_thread(), since there are more
threads to come.
2004-09-13 17:44:47 +00:00
le
876ffa30db Save the config back to disk when a drive goes down. 2004-09-13 17:33:52 +00:00
le
b19a8d0082 Read a whole sector instead of GV_HDR_LEN, since a sector might be
bigger (i.e. on CD-ROMs).
2004-09-13 17:27:58 +00:00
pjd
a5693287e1 Make kern.geom.debugflags sysctl tunable from /boot/loader.conf.
It will help to debug problems when booting.

Approved by:	phk
2004-09-13 14:58:27 +00:00
phk
3e1bf8d8b5 Fix a problem that shows up if less than the full complement of
lock sectors are defined ("number_of_keys" argument to gbde init being
less than 4 in the default compile).
2004-09-11 17:58:53 +00:00
phk
9b11b1fb2c Respect that G_BDE_MAXKEYS is a compile time variable. 2004-09-11 17:57:51 +00:00
fjoe
7531fcdf4d Do not compile in zlib.c. Add a dependency on module instead. 2004-09-08 17:27:31 +00:00
pjd
555e9e698d Show current status of mirror device directly.
Suggested by:	Krzysztof Ciep³ucha <kris@home.pl>
2004-09-08 16:37:22 +00:00
phk
38ae102f61 For removable devices without media we set a zero mediasize but a non-zero
sectorsize in order to avoid a lot of checks around various divisions etc.

Enforce the sectorsize being > 0 with a KASSERT on successful open.

Fix scsi_cd.c to return 2k sectors when no media inserted.
2004-09-05 21:15:58 +00:00
pjd
4689077c9e Allow to configure debug level from /boot/loader.conf. 2004-08-30 18:50:06 +00:00
phk
02b88adf06 Add more KASSERTS and checks. 2004-08-30 09:33:06 +00:00
pjd
3bedfb04b2 GCC, ehh. 2004-08-29 14:29:30 +00:00
pjd
354291a750 Use sc->sc_mediasize instead of sc->sc_provider->mediasize which contains
exactly the same value, but is shorter.
2004-08-28 02:35:43 +00:00
pjd
2d011d4672 Warn the user if we are not going to use whole provider space.
Requested by:	Michael Handler <handler@grendel.net>
2004-08-28 02:34:10 +00:00
pjd
f7c5bbc8f2 Don't allow to insert providers, which are too small.
Reported by:	Michael Handler <handler@grendel.net>
2004-08-28 02:02:48 +00:00
le
440914a8bb Move config_new_drive() to the correct place and rename it to
gv_config_new_drive().
2004-08-27 21:32:18 +00:00
phk
4759b478a2 Introduce g_alloc_bio() as a waiting variant of g_new_bio().
Use in places where we can sleep and where we previously failed to check
for a NULL pointer.

MT5 candidate.
2004-08-27 14:43:11 +00:00
le
0fd3e9eb56 When attaching a consumer from a volume to a plex, check if the
volume already has a plex attached and adjust the access counts
of the new consumer accordingly.
2004-08-26 21:04:41 +00:00
pjd
7f46afc9bf Skip providers with not defined sector size.
Reported by:	kuriyama
2004-08-26 12:42:47 +00:00
pjd
18cd875885 Log verification errors at level 1. 2004-08-25 19:18:07 +00:00
pjd
a2512dc38e Dump disk number. 2004-08-25 12:14:44 +00:00
pjd
02488a6b3c Allow to set kern.geom.mirror.timeout from /boot/loader.conf. 2004-08-23 20:42:34 +00:00
le
b83d5cd619 Compare the addresses of two RAID5 work packets directly instead
of the addresses of their related bios when locking one out, since
they could share a bio and this could lead to parity corruption.
2004-08-23 17:50:18 +00:00
le
a52623fe58 Implement the possibility to remove drives. 2004-08-22 17:07:55 +00:00
pjd
7e2ef21ad9 Implementation of 'verify reading' algorithm, which uses parity data for
verification of regular data when device is in complete state.
On verification error, EIO error is returned for the bio and sysctl
kern.geom.raid3.stat.parity_mismatch is increased.

Suggested by:	phk
2004-08-22 16:21:12 +00:00
le
9c58beacac Add forgotten format specifier in a KASSERT and shut up the compiler.
Submitted by: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
2004-08-22 13:34:24 +00:00
pjd
2acdd880f4 Add version history. 2004-08-21 21:15:03 +00:00
pjd
c3c6740d1a Implement new reading algorithm, which will use parity component for reading
as well, even if device is in complete state.
I observe 40% of speed-up with this option for random read operations,
but slowdown for sequential reads.
Basically, without this option reading from a RAID3 device built from 5
components (c0-c4) looks like this:

	Request no.	Used components
	1		c0+c1+c2+c3
	2		c0+c1+c2+c3
	3		c0+c1+c2+c3

With the new feature:

	Request no.	Used components
	1		c0+c1+c2+c3
	2		(c1^c2^c3^c4)+c1+c2+c3
	3		c0+(c0^c2^c3^c4)+c2+c3
	4		c0+c1+(c0^c1^c3^c4)+c3
	5		c0+c1+c2+(c0^c1^c2^c4)
	6		c0+c1+c2+c3
	[...]
2004-08-21 18:11:46 +00:00
le
7f135ded9a A volume can be up if it has a degraded RAID5 plex. 2004-08-19 12:03:27 +00:00
pjd
ad8a5e508d We really don't want to receive spoil event for synchroniztion consumers. 2004-08-18 23:33:37 +00:00
phk
90dd7ea538 Do not override the class provided dumpconf function. 2004-08-18 21:42:08 +00:00
le
89428b4ca7 Pretty print some informational messages. 2004-08-18 20:43:56 +00:00
le
fc5a15a34b Fix a stupid bug in the drive taste function: when checking if a
drive is known to the configuration check also if it already has a geom.
Without this check several needless geoms are created and valid
configuration data was overwritten.

This change obsoletes the need for a separate geom to taste an
offered provider and the consumer doesn't need to be opened with the
exclusive bit set.
2004-08-18 20:34:45 +00:00
pjd
596d3e1549 NOP class doesn't operate on metadata, so the spoil event can be safely
ignored.
2004-08-18 16:58:42 +00:00
pjd
5900ea888d Dump device status on 'list' command. 2004-08-18 16:46:51 +00:00
pjd
7a2e943ef3 Bump synchronization ID if we are sure, that we have ACTIVE components. 2004-08-18 07:28:48 +00:00
obrien
652905e47a Minor style.9 cleanup. 2004-08-16 10:33:35 +00:00
pjd
023b80f953 Decrease debug level to 0. 2004-08-16 08:33:04 +00:00
pjd
d68b744f16 Fix warning. 2004-08-16 08:21:31 +00:00
pjd
8394d51046 Introduce GEOM RAID3 class, i.e. kernel module, which implements RAID3
transformation and graid3(8) userland utility, which can be used for
configuration. No manual page yet, sorry.

Hardware provided by:	Daniel Seuffert
2004-08-16 06:23:14 +00:00
pjd
210c7636d4 Avoid code duplication by introducing g_mirror_write_metadata() function,
which is used now by g_mirror_clear_metadata() function and
g_mirror_update_metadata() function.
2004-08-15 13:58:29 +00:00
le
3d9480a588 Make informational output look less like an accident. 2004-08-14 09:56:17 +00:00
fjoe
50b0c5e0ac Add geom_uzip -- geom class that implements read-only compressed disks.
Currently supports cloop V2.0 disk compression format.
May support more formats in future.
2004-08-13 09:40:58 +00:00
pjd
d1919d7938 MFp4: Simplify code a bit:
- Remove kern.geom.mirror.sync_block_size sysctl. It is quite obvious that we
  want to use the biggest size possible.
- Do not use UMA zone for sync data allocations. There could be only one
  synchronization request per synchronized disk at a time, so allocate memory
  for one request on whole synchronization process related to one disk.

Tested by synchronizing one component (out of three) and by synchronizing
two components (out of three) in parallel.
2004-08-11 23:41:53 +00:00
pjd
2f865036c5 Actually, HARDCODED flag isn't stored in metadata, so don't bother
dumping it.
2004-08-11 22:16:42 +00:00
pjd
e5e3810748 - Fix typo.
- Dump HARDCODED flag.
2004-08-11 22:12:44 +00:00
pjd
1f559bc298 Increase default kern.geom.stripe.maxmem to 50 elements. 2004-08-11 12:57:17 +00:00
pjd
8623e8af4d When sending request once again because of ENOMEM, reset bio_children
and bio_inbed fields to 0. Without this change we can end up with
I/O leakage in some rare situations.
I tested this change by putting failure probability mechanism simlar
to this used in NOP class into g_clone_bio(9) function, so it was
able to return NULL with the given probability.

Discussed with:	phk
2004-08-11 12:04:35 +00:00
pjd
dd8a1c6e2a Try harder to not panic on 'stop -f'.
After the commit, this command should be really safe to use.
2004-08-11 11:10:46 +00:00
le
8bc23a2edf If we kill the worklist thread of a RAID5 plex we can destroy
the worklist mutex at the same time, so move the mtx_destroy() call
to gv_kill_thread().
2004-08-10 20:51:48 +00:00
le
627d263e7e Lock the topology before calling gv_parse_config, not afterwards. 2004-08-10 20:15:12 +00:00
pjd
2d1d801e5f - Recognize HARDCODED flag when dumping consumer configuration.
- Improve code readabilty a bit.
2004-08-10 19:53:31 +00:00
pjd
f0d4b9a881 Forgot to commit those: introduce hardcoded provider functionality,
which allow to store provider's name in the metadata and avoid
problems when few providers share the same last sector.
2004-08-10 19:52:12 +00:00
pjd
4792c96714 Fix one of the lastest commit. This bio_caller1 should also be changed to
bio_driver1 (as all the rest).
This introduced a small memory leak, but it wasn't really critical,
because maximum memory for g_stripe_zone is always set, so after few
requests gstripe was working in "economic" mode.
2004-08-10 19:07:55 +00:00
pjd
a98f255700 - Introduce option for hardcoding providers' names into metadata.
It allows to fix problems when last provider's sector is shared between few
  providers.
- Bump version number for CONCAT and STRIPE and add code for backward
  compatibility.
- Do not bump version number of MIRROR, as it wasn't officially introduced yet.
  Even if someone started to play with it, there is no big deal, because
  wrong MD5 sum of metadata will deny those providers.
- Update manual pages.
- Add version history to g_(stripe|concat).h files.
2004-08-09 11:29:42 +00:00
pjd
8da7f212eb Do not use g_wither_geom(9). I doesn't work in the way which is expected
here anymore (after g_wither_washer() was introduced), i.e. geom and consumer
will not be immediately destroyed if possible.
2004-08-09 11:14:25 +00:00
phk
b3e3b3af61 Too many versions.
Spotted by:	pjd
2004-08-09 06:04:00 +00:00
phk
685cf0583f OK, now check geom class version numbers. 2004-08-08 08:34:46 +00:00
phk
d8d2b01380 Tag all geom classes in the tree with a version number. 2004-08-08 07:57:53 +00:00
phk
2568a59fae OOps, that check was a bit premature. Allow zero versions as well. 2004-08-08 07:30:47 +00:00
phk
8a11f1b4a6 Use default method initialization on geoms. 2004-08-08 06:49:07 +00:00
phk
e7ff003728 Give classes a version number and refuse to touch classes which are not
understood.  This makes room for additional binary compatibility in the
future.

Put fields in the class for the geom's methods and initialize the methods
of a new geom from these fields.  This saves some code in all classes.
2004-08-08 06:46:27 +00:00
pjd
5ce00478e0 Add and document kern.geom.stripe.fast_failed sysctl, which shows how
many times "fast" mode failed.
2004-08-06 10:19:34 +00:00
pjd
2d5face9e3 Fields bio_caller[12] should be used by the consumer and fields
bio_driver[12] should be used by the provider!
2004-08-06 10:07:03 +00:00
pjd
636f0ba584 Fix I/O leakage. We're cloning bios in g_stripe_start_fast(), but when
something goes wrong while running in "fast" mode, we free all bios and
falling back to "economic" mode. Freeing bios, doesn't mean decrease
bio_children, so bio_inbed couldn't be equal to bio_children and request
was never finished.
Decrease bio_children manually when destroying bios.

Reported by:	Sam Lawrance <boris@brooknet.com.au>, simon
2004-08-06 09:55:40 +00:00
pjd
2a65f27c4f Don't use 'bp' after its destruction! 2004-08-05 14:07:21 +00:00
pjd
a762088315 Simplify a bit - we could use 'sc' here as it was initialized properly. 2004-08-05 13:22:17 +00:00
pjd
0b32901632 - Add two fields to bio structure: 'bio_cflags' which can be used by
consumer and 'bio_pflags' which can be used by provider.
- Remove BIO_FLAG1 and BIO_FLAG2 flags. From now on new fields should be
  used for internal flags.
- Update g_bio(9) manual page.
- Update some comments.
- Update GEOM_MIRROR, which was the only one using BIO_FLAGs.

Idea from:	phk
Reviewed by:	phk
2004-08-04 21:35:05 +00:00
pjd
c111951680 - Add "prefer" balance algorithm. When used, only disk with the biggest
priority will be used for reading.
- Bump version number.
2004-08-04 12:09:53 +00:00
pjd
a107bfb237 MFp4: We don't really need g_mirror_free_disk() function. 2004-08-04 10:02:06 +00:00
pjd
f381f9a205 Fix comment. 2004-08-03 15:41:33 +00:00
pjd
889eca7e19 - Fix unloading by the same way it is done in my other classes:
set gp->softc to NULL and return ENXIO when it is NULL, so GEOM
  will not panic or hang, but unload one device on every 'unload'.
  This make 'unload' command usable, but it have to be executed
  <number of devices> + 1 times.
- Made use of 'pp' variable.
2004-08-02 00:37:40 +00:00
pjd
1dba5c34f9 Typo. 2004-08-01 20:41:58 +00:00
pjd
e628843899 - Launch main provider when there are no more disks in NEW state.
- Log syncid bump at debug level 1.
2004-08-01 09:01:50 +00:00
pjd
578bfcb897 If there are no valid components after the timeout, just destroy device.
There is probably nothing to wait for.
2004-07-31 22:10:51 +00:00
le
e2ca49b0bc Propagate size changes upwards. 2004-07-31 21:34:21 +00:00
pjd
e0a971d6d4 Handle spoil event in dedicated function: g_mirror_spoiled().
The different between the new function and g_mirror_orphan() (which was
used previously) is that syncid is bumped immediately, instead of on
first write, because when consumer was spoiled, it means, that its
provider was opened for writing, so we can't trust that its data
will be valid when it will be connected again.
2004-07-31 21:08:17 +00:00
pjd
e9aabe3b50 Remove unused field. 2004-07-31 13:03:38 +00:00
pjd
cd4a05fa81 Destroy synchronization geom immediately. This should fix unloading without
stopping all mirrors.
2004-07-31 11:22:03 +00:00
pjd
6bb53152ba Allow slice creation on providers from MIRROR class.
This should allow mounting root file system from a mirror.
2004-07-31 01:17:20 +00:00
pjd
0d74239c00 Add '-p' option for 'insert' command which allows to specify priority
of the new component.
Version number wasn't bumped (it should be), because I think there are
no geom_mirror users yet.
2004-07-31 00:54:44 +00:00
pjd
8c9f26b7ea - Check if 'slice' argument was given.
- Check if disk isn't already the mirror component.
2004-07-31 00:51:33 +00:00
pjd
ecaa6b91a6 Dump correct field. 2004-07-31 00:37:14 +00:00
le
d9c517d66a Set the access counts of a subdisk correctly when attaching it
to a plex that already has subdisks.
2004-07-30 23:40:38 +00:00
pjd
adaa0482b4 Add GEOM_MIRROR class which provide RAID1 functionality and has many useful
features. The gmirror(8) utility should be used for control of this class.
There is no manual page yet, but I'm working on it with keramida@.

Many useful tests provided by:	simon (thank you!)
Some ideas from:		scottl, simon, phk
2004-07-30 23:13:45 +00:00
pjd
6e57ee9a4c Nuke geom_mirror class. New geom_mirror class is in the way.
Approved by:	phk
2004-07-30 19:59:36 +00:00
pjd
0560d38991 Allow to create slices on providers from class LABEL and class NOP.
This is really ugly way to do this, but there is no other way for now.
It allows to mount root file system from providers which belong to
those classes.

Approved by:	phk
2004-07-30 19:55:12 +00:00
pjd
7a7cae7b30 - Add '-S' option, which allow to specify sector size for transparent
provider.
- Bump version number.

This allows for a quite interesting trick. One can setup a stripe with
stripe size of 512 bytes and create transparent provider on top of it
with sector size equal to <ndisks> * 512. The result will be something
like RAID3 without parity disk (every access will touch all disks).
2004-07-30 08:19:22 +00:00
le
8e620f7e71 Shut up the compiler and temporarily '#if 0' gv_destroy_geom(),
until we need it again.
2004-07-29 11:32:09 +00:00
pjd
73a684d587 Improve geom(8)'s 'list' command to show geoms and their providers and
consumers. Teach STRIPE, CONCAT and NOP classes about this improvement.
2004-07-26 17:14:47 +00:00
pjd
3a2f13d5f5 Change naming scheme from /dev/<name>.stripe to /dev/stripe/<name>. 2004-07-26 16:10:27 +00:00
pjd
badd010cc7 Change naming scheme from /dev/<name>.concat to /dev/concat/<name>. 2004-07-26 16:08:32 +00:00
pjd
dca201cdfb M_WAITOK is ok here, while I'm using M_WAITOK later in this function. 2004-07-26 15:41:28 +00:00