summaryrefslogtreecommitdiffstats
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* - Fix 'rebuild' command - it can no longer relay on retaste eventpjd2005-01-043-50/+34
| | | | | | | | (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
* Spoiling is now not possible, because we keep consumers open for writingpjd2005-01-043-38/+13
| | | | | | all the time. Remove unused code then. MFC after: 4 days
* Fix 'rebuild' command (we ignore retaste event now, so don't relay on it).pjd2005-01-033-11/+23
|
* Remove unused #include.pjd2005-01-031-1/+0
|
* Stop explicitly touching td_base_pri outside of the scheduler and simplyjhb2004-12-303-6/+19
| | | | | set a thread's priority via sched_prio() when that is the desired action. The schedulers will start managing td_base_pri internally shortly.
* Remove debug code.pjd2004-12-281-10/+2
|
* - Add genid field to the metadata which will allow to improve reliability a bit.pjd2004-12-253-61/+206
| | | | | | | | | | | | | | | 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.
* Update disk->d_genid field when increasing sc->sc_genid.pjd2004-12-231-0/+1
|
* - Add genid field to the metadata which will allow to improve reliability a bit.pjd2004-12-223-57/+185
| | | | | | | | | | | | | | | | 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.
* Now, when force device destruction is done on shutdown, hide warning,pjd2004-12-212-2/+2
| | | | | | that device cannot be destroyed immediately, under debug=1. Suggested by: simon
* Improve reliability and clean up code a bit.pjd2004-12-211-189/+140
| | | | For more details check src/sys/geom/mirror/g_mirror.c rev.1.47,1.48,1.49,1.50.
* This should not be permitted, but some GEOM classes held the topology lockpjd2004-12-211-6/+30
| | | | | | 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.
* Implement g_topology_try_lock().pjd2004-12-211-0/+2
| | | | No objection from: phk
* Remove unused variables.pjd2004-12-191-6/+1
|
* - Argument 'flags' in g_mirror_destroy_consumer() function is unsed -pjd2004-12-191-2/+3
| | | | | | 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().
* Some major cleanups.pjd2004-12-191-175/+107
| | | | | | | | | | | | | | | | | | | | | | 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.
* Don't quit on first failure, just skip failures.pjd2004-12-191-6/+6
|
* Fix typo in a comment.brueffer2004-12-151-1/+1
| | | | MFC after: 3 days
* bioq_insert_head() function is already in subr_disk.c.pjd2004-12-131-10/+0
|
* Pass the file->flags down to geom ioctl handlers.phk2004-12-126-8/+20
| | | | | | | | Reject certain ioctls if write permission is not indicated. Bump geom API version. Reported by: Ruben de Groot <mail25@bzerk.org>
* - Turn off 'fast' mode by default and increase maximum memory to consumepjd2004-12-091-2/+2
| | | | | when this mode is used. - Manual page update.
* o Don't limit GPT as a rank 2 provider. Allow it to be connectedmarcel2004-12-051-17/+25
| | | | | | | | | anywhere in the DAG. This includes configurations that are not allowed by the EFI specification. o Reject a GPT partition table if it's not preceeded by a PMBR. There's no need to preserve the MBR partitioning anymore as GPT is mature and with the first bullet extending the applicability of GPT, it's better to be a bit more strict.
* When initializing device, set d_softc and d_no fields for all components,pjd2004-12-041-3/+4
| | | | | | | | because we know it then and we need it when inserting a component which wasn't destroyed while device was running. Reported by: Michael Handler <handler@grendel.net> MFC after: 1 week
* Add observations of the Linux98 and Grub/98 boot loaders. Theseimp2004-11-301-5/+15
| | | | | | | | | observations lead me to believe that the convetion for pc98 boot loaders is to have a jump unstruction, followed by a string, followed by code. The jump usually doesn't have a nop after it and usually the string is NUL terminated, but Grub/98 breaks both of these rules. # I looked for, but failed to find the Minux boot blocks for PC-9801 port.
* Reject tasting of this provider if the sector size isn't a multiple ofimp2004-11-301-3/+6
| | | | | | | | | | | | | | | | | | | 512. If I had an audio cdrom in my cd player when I booted my system, I'd get a panic from geom because you can't read 8192 bytes from an audio cdrom. Remove XXX comment about IPL1 and replace it with some information from my soon to be published web page on the pc98 disk layout. The IPL1 test was the result of an observation of a disk with FreeBSD's boot0 program. It was testing part of an area what appears to be reserved for a boot loader name, which comes after a jump over this area. I don't yet know if it is required to be any specific jump instruction, or if the destination has to be location 11. [1] [1] FreeBSD Press No. 13, page 115, poorly translated by myself. The picture there shows offset 8 as the destination of the jump, but FreeBSD's boot0 program has three padding NULs after the IPL1 name and uses a 16-bit 'jmp' instruction.
* Fix a long standing bug in geom_mbr which is only now exposed by thephk2004-11-281-4/+14
| | | | | | | | | | | | | | | correct open/close behaviour of filesystems: When an ioctl to modify the MBR arrives, we cannot take for granted that we have the consumer open. The symptom is that one cannot run 'boot0cfg -s2 /dev/ad0' in single-user mode because / is the only open partition in only open r1w0e1. If it is not, we attempt to increase the write count by one and decrease it again afterwards. Presumably most if not all other slices suffer from the same problem.
* Implement 'setstate' to allow setting the state of drives and subdisksle2004-11-263-5/+82
| | | | for debugging and emergency purposes.
* Implement checkparity/rebuildparity.le2004-11-267-13/+316
|
* - Add missing Giant drop before acquiring the topology lock.pjd2004-11-231-3/+6
| | | | - Move DROP_GIANT()/PICKUP_GIANT() to g_gate_ioctl().
* Use M_ZERO to not panic in mtx_init when INVARIANTS enabled.fjoe2004-11-201-1/+1
| | | | | Submitted by: simokawa MFC after: 1 week
* Move RAID5 offset calculation into a separate function to avoidle2004-11-151-50/+56
| | | | code duplication.
* Share gv_roughlength() between kernel and userland, as we will need itle2004-11-154-36/+36
| | | | there later.
* Before trying to update metadata (so open consumer for writing), be surepjd2004-11-092-21/+53
| | | | | | | | | | that the events queue is empty. In other case we're able to hit the race where for example da0s1 is tasted by some other class, which means that da0 is open with exclusive bit set, which means that we can't open da0 for writing if it is our component. Reported by: Attila Nagy <bra@fsn.hu> (and somebody else sometime ago, but I cannot find who it was)
* Introduce g_waitidlelock() function which is simlar to g_waitidle(),pjd2004-11-092-0/+13
| | | | | | | but should be called with the topology lock held and returns with the topology lock held and empty event queue. Approved by: phk (sometime ago)
* Don't rely on DIRTY flag to be sure that consumer if open, becausepjd2004-11-092-2/+2
| | | | | DIRTY flag can be removed in idle process. Use consumer's acw field instead to avoid opening consumer twice.
* For BIO_READ check if provider is open for reading and for BIO_WRITE,pjd2004-11-091-3/+11
| | | | | | check if provider is open for writing. This fixes panic when device is open only for writing and we send write request.
* Drop Giant lock before grabbing the topology lock.pjd2004-11-092-0/+4
|
* If device is marked as beeing destroyed, deny all access requests.pjd2004-11-082-2/+4
|
* Don't forget to make sure that there are no not-finished requests beforepjd2004-11-052-30/+66
| | | | | | marking components as clean. Pointed out by: scottl
* - Mark all raid3 components as clean after kern.geom.raid3.idletime seconds.pjd2004-11-052-2/+82
| | | | - Make kern.geom.raid3.timeout variable tunable.
* Mark raid3 devices as clean on shutdown (after all file systems arepjd2004-11-051-3/+52
| | | | | | unmounted). Suggested by: scottl
* - Use ->index consumer's field to track number of in-flight requests.pjd2004-11-051-2/+10
| | | | - Remove unused #include.
* Use shutdown hooks to mark mirrors as clean after all file systems arepjd2004-11-051-1/+47
| | | | | | unmounted. Suggested by: scottl
* Remove unused #include.pjd2004-11-051-1/+0
|
* - Add a sysctl kern.geom.mirror.idletime, so one can specify after how manypjd2004-11-051-13/+37
| | | | | | | | 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.
* MFp4:pjd2004-11-052-13/+69
| | | | | | | | | | | | | | | | | | | | | | - 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.
* Finish cut&paste adjustments.phk2004-11-041-1/+1
| | | | Spotted by: tegge
* Stop dumping the MBR entries under bootverbosephk2004-11-031-2/+2
|
* Stop wasting a bootverbose line on all geom slices.phk2004-11-031-1/+1
|
* Don't set si_bsize_phys, nobody cares.phk2004-10-291-2/+0
|
OpenPOWER on IntegriCloud