Commit Graph

939 Commits

Author SHA1 Message Date
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
Pawel Jakub Dawidek
e35d3a7828 - 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
Dag-Erling Smørgrav
04550802d8 merge from geom_vol_ffs.c rev 1.14 (avoid unaligned I/O requests) 2005-02-08 12:34:11 +00:00
Dag-Erling Smørgrav
363de7f683 Take care not to issue unaligned I/O requests while tasting a provider. 2005-02-08 08:04:23 +00:00
Pawel Jakub Dawidek
662a4e5878 - 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
Poul-Henning Kamp
3ad9f7c2c5 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 Roberson
1907e62037 - If mpsafevfs is off, acquire giant around all calls to bufdone().
Sponsored by:   Isilon Systems, Inc.
2005-01-28 16:04:44 +00:00
Poul-Henning Kamp
84a6975215 Introduce and use g_vfs_close(). 2005-01-25 15:52:04 +00:00
Poul-Henning Kamp
bc0fc6fcc3 Create a correctly sized vnode objects for disk devices. 2005-01-24 22:41:21 +00:00
Jeff Roberson
e9f3e3f8ca - Don't acquire giant around calls to bufdone().
Sponsored By:   Isilon Systems, Inc.
2005-01-24 10:47:46 +00:00
Lukas Ertl
f9b7569c09 Only report state changes of subdisks and plexes when there's
really a state change.

Reword the info a bit.
2005-01-21 18:27:23 +00:00
Lukas Ertl
0d93122102 Don't initialize error with ENXIO as we might end up here when
the plex has no more consumers (e.g. orphaning).
2005-01-21 18:24:20 +00:00
Pawel Jakub Dawidek
857d14cbc9 Protect against recursive slices creation in simlar way as it is done
in BSD class, ie. if provider below us uses the same metadata, don't
create slices based on the metadata.
This allows to create slices on geoms with rank != 1 without hacks.

Discussed with:	phk
Approved by:	phk
MFC after:	2 weeks
2005-01-20 22:14:05 +00:00
Lukas Ertl
eba5b9dfce Rename synchronization and initialization threads and prefix them
with 'gv_' for consistency.
2005-01-19 14:49:26 +00:00
Lukas Ertl
f11c507c45 Although an object may already be known in the configuration, it's
worker thread may have been destroyed (e.g. during orphaning).

Make sure that objects get back their worker threads when they get a
new geom.
2005-01-19 14:08:16 +00:00
Lukas Ertl
3b6cdf438a Reset object flags after killing off an object's worker thread. 2005-01-19 13:57:09 +00:00
Poul-Henning Kamp
e8cde1ac6f Discontinue zero-length g_ctl arguments as "just give him this pointer"
transfers.  The necessary context for calling copyin() isn't available
anyway and automatic code-validation chokes on this.
2005-01-17 07:14:24 +00:00
Poul-Henning Kamp
032bc81d4d CAM will sometimes remove a disk again even before it finished being
initialized.  We already cancel the pending events but we need to not
dereference the geom pointer which never got set different from NULL.
2005-01-14 21:05:35 +00:00
Pawel Jakub Dawidek
080361d6b8 Introduce a new GEOM class - SHSEC. It provides sharing secret between
the given providers. Without even one of the configured components there
should be no way to get the secret.

Supported by:	WHEEL Sp. z o.o.
		http://www.wheel.pl
2005-01-11 18:06:44 +00:00
Poul-Henning Kamp
6ef8480a88 Add BO_SYNC() and add a default which uses the secret vnode pointer
and VOP_FSYNC() for now.
2005-01-11 10:43:08 +00:00
Pawel Jakub Dawidek
437566858a Increase default synchronization speed.
MFC after: 3 days
2005-01-09 14:43:39 +00:00
Warner Losh
fa521b0366 /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-06 18:27:30 +00:00
Pawel Jakub Dawidek
ea973705b3 - Fix 'rebuild' command - it can no longer relay on retaste event
(we ignore it).
- Remove code used for handling spoil events, as spoiling is not possible
  anymore, because we keep consumers open for writing all the time.

MFC after:	4 days
2005-01-04 12:15:21 +00:00
Pawel Jakub Dawidek
da84416791 Spoiling is now not possible, because we keep consumers open for writing
all the time. Remove unused code then.

MFC after:	4 days
2005-01-04 12:11:49 +00:00
Pawel Jakub Dawidek
fd6d312082 Fix 'rebuild' command (we ignore retaste event now, so don't relay on it). 2005-01-03 19:42:37 +00:00
Pawel Jakub Dawidek
cdca9c06d9 Remove unused #include. 2005-01-03 12:53:10 +00:00
John Baldwin
63710c4d35 Stop explicitly touching td_base_pri outside of the scheduler and simply
set a thread's priority via sched_prio() when that is the desired action.
The schedulers will start managing td_base_pri internally shortly.
2004-12-30 20:29:58 +00:00
Pawel Jakub Dawidek
7f456a7d61 Remove debug code. 2004-12-28 21:52:45 +00:00
Pawel Jakub Dawidek
a245a5483c - Add genid field to the metadata which will allow to improve reliability a bit.
After this change, when component is disconnected because of an I/O error,
  it will not be connected and synchronized automatically, it will be logged
  as broken and skipped. Autosynchronization can occur, when component is
  disconnected (on orphan event) and connected again - there were no I/O
  error, so there is no need to not connected the component, but when there were
  writes while it wasn't connected, it will be synchronized.
  This fix cases, when component is disconnected because of I/O error and can be
  connected again and again.
- Bump version number.
- Implement backward compatibility mechanism. After this change when metadata in
  old version is detected, it is automatically upgraded to the new (current)
  version.
2004-12-25 19:17:47 +00:00
Pawel Jakub Dawidek
538ff5ee7a Update disk->d_genid field when increasing sc->sc_genid. 2004-12-23 21:15:15 +00:00
Pawel Jakub Dawidek
9a9f504132 - Add genid field to the metadata which will allow to improve reliability a bit.
After this change, when component is disconnected because of an I/O error,
  it will not be connected and synchronized automatically, it will be logged
  as broken and skipped. Autosynchronization can occur, when component is
  disconnected (on orphan event) and connected again - there were no I/O
  error, so there is no need to not connected the component, but when there were
  writes while it wasn't connected, it will be synchronized.
  This fix cases, when component is disconnected because of I/O error and can be
  connected again and again.
- Bump version number.
- Add version change history.
- Implement backward compatibility mechanism. After this change when metadata in
  old version is detected, it is automatically upgraded to the new (current)
  version.
2004-12-22 23:09:32 +00:00
Pawel Jakub Dawidek
4485f00081 Now, when force device destruction is done on shutdown, hide warning,
that device cannot be destroyed immediately, under debug=1.

Suggested by:	simon
2004-12-21 19:50:18 +00:00
Pawel Jakub Dawidek
d97d5ee931 Improve reliability and clean up code a bit.
For more details check src/sys/geom/mirror/g_mirror.c rev.1.47,1.48,1.49,1.50.
2004-12-21 19:30:59 +00:00
Pawel Jakub Dawidek
f663832b75 This should not be permitted, but some GEOM classes held the topology lock
while doing g_(read|write)_data() (e.g. BSD). This can cause a deadlock
in MIRROR class. Not sure if this is safe to drop the topology lock in BSD
class, so change the code in MIRROR class to avoid this deadlock.
2004-12-21 18:42:51 +00:00
Pawel Jakub Dawidek
54bab03f04 Implement g_topology_try_lock().
No objection from:	phk
2004-12-21 18:32:46 +00:00
Pawel Jakub Dawidek
dc7d54e7b3 Remove unused variables. 2004-12-19 23:55:49 +00:00
Pawel Jakub Dawidek
a2a7b44de0 - Argument 'flags' in g_mirror_destroy_consumer() function is unsed -
mark it as such.
- Before closing consumer check if it is open. It can be closed here
  when g_mirror_connect_disk() fails on g_access().
2004-12-19 23:33:59 +00:00
Pawel Jakub Dawidek
9eec299fab Some major cleanups.
Keeping consumers open when device is closed is very hard. We need to
open consumers sometimes to update metadata, etc.
Many hacks was introduced in the past to made it possible. You cannot
be sure that you can open consumer for writing always, even if you think
it should be allowed. If one of the mirror components is for example da0
and you try to open it, you can get EPERM when da0s1 is opened for reading
(because BSD class opens consumers (da0) with an extra 'e' bit set).
Waiting for the events queue to be empty may do the trick, but it makes
code much uglier (as you cannot always call g_waitidle()), it doesn't
solve all edge cases and it can introduce deadlocks if there are events
in the queue that wait for gmirror.

I removed those hacks. Now all consumers are open r1w1e1 always, even if
device is closed. Maybe it is less clean from GEOM perspective, but simpify
code a lot and make it much more reliable.
The only issue was retaste event which is sent when we close consumers
opened for writing. I ignore retaste event by not detaching consumer
immediately (so retaste event is not send to my class) and sending event
right after it to detach and destroy consumer.
2004-12-19 23:12:00 +00:00
Pawel Jakub Dawidek
c37e2f9bbf Don't quit on first failure, just skip failures. 2004-12-19 22:58:25 +00:00
Christian Brueffer
44d086bde6 Fix typo in a comment.
MFC after:	3 days
2004-12-15 12:18:41 +00:00
Pawel Jakub Dawidek
89dd8e5326 bioq_insert_head() function is already in subr_disk.c. 2004-12-13 13:02:06 +00:00
Poul-Henning Kamp
2221dbebce Pass the file->flags down to geom ioctl handlers.
Reject certain ioctls if write permission is not indicated.

Bump geom API version.

Reported by:	Ruben de Groot <mail25@bzerk.org>
2004-12-12 10:09:05 +00:00