summaryrefslogtreecommitdiffstats
path: root/sys/geom/mirror
Commit message (Collapse)AuthorAgeFilesLines
* Remove dead code.pjd2006-01-181-2/+0
| | | | | | Found by: Coverity Prevent(tm) Coverity ID: CID104 MFC after: 3 days
* Check for g_read_data(9) errors properly:sobomax2005-11-301-1/+1
| | | | | | | | | | o The only indication of error condition is NULL value returned by the function; o value pointed to by error argument is undefined in the case when operation completes successfully. Discussed with: phk
* Normalize a significant number of kernel malloc type names:rwatson2005-10-311-1/+1
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* After provider creation!!pjd2005-05-251-6/+6
|
* - Call root_mount_rel() when provider IS created, not earlier.pjd2005-05-251-8/+20
| | | | | This should close the race observed by Daniel Eriksson. - Remove redundant wakeup().
* Add some debug code to diagnose root-on-mirror problems with recent -current.pjd2005-05-231-0/+3
| | | | Reported by: Daniel Eriksson
* Add KASSERT() to be sure there is an active component.pjd2005-05-111-0/+1
| | | | Suggested by: Coverity Prevent analysis tool
* Fix provider's size check for 'insert' command.pjd2005-04-251-1/+2
| | | | | | Before this fix one was able to insert one sector too small provider. MFC after: 3 days
* Remove the hack which allowed to use gmirror for root file system,pjd2005-04-192-49/+8
| | | | use root_mount KPI instead.
* Make the code more obvious - when an error occurs in g_mirror_connect_disk(),pjd2005-03-261-9/+13
| | | | detach and destroy consumer before returning.
* Check for return values.pjd2005-03-261-0/+12
| | | | | Submitted by: sam Found by: Coverity Prevent analysis tool
* - Add md_provsize field to metadata, which will help withpjd2005-02-272-3/+48
| | | | | | | | | | | | | | | | | 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
* Update copyright in files changed this year.pjd2005-02-163-3/+3
|
* Increase default synchronization speed.pjd2005-01-091-1/+1
| | | | MFC after: 3 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
|
* Stop explicitly touching td_base_pri outside of the scheduler and simplyjhb2004-12-301-1/+4
| | | | | set a thread's priority via sched_prio() when that is the desired action. The schedulers will start managing td_base_pri internally shortly.
* 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-211-1/+1
| | | | | | that device cannot be destroyed immediately, under debug=1. Suggested by: simon
* 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.
* 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
|
* Before trying to update metadata (so open consumer for writing), be surepjd2004-11-091-10/+27
| | | | | | | | | | 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)
* Don't rely on DIRTY flag to be sure that consumer if open, becausepjd2004-11-091-1/+1
| | | | | DIRTY flag can be removed in idle process. Use consumer's acw field instead to avoid opening consumer twice.
* Drop Giant lock before grabbing the topology lock.pjd2004-11-091-0/+2
|
* If device is marked as beeing destroyed, deny all access requests.pjd2004-11-081-1/+2
|
* Don't forget to make sure that there are no not-finished requests beforepjd2004-11-051-16/+33
| | | | | | marking components as clean. Pointed out by: scottl
* 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.
* Ehh. Introduce a hack: Wait for 3 seconds, so GEOM is able to give uspjd2004-10-141-0/+5
| | | | | | | | | | | | 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>
* Be sure to always return 0 for negative access requests.pjd2004-10-071-0/+8
| | | | Reported by: Maciej Kucharz <qk@comp.waw.pl>
* Geoms without softc are geoms which are initialized, so wait for them.pjd2004-10-061-2/+4
|
* Look out for geoms without softc.pjd2004-10-061-0/+2
| | | | Reported by: tegge
* Before root file system is mounted, wait for mirrors in degraded state.pjd2004-10-051-0/+41
|
* Just use MAXPHYS as maximum I/O request size, instead of using my ownpjd2004-09-282-10/+4
| | | | | #define for this purpose. No functional change.
* Minor, but very important condition fix. The current one can never be true.pjd2004-09-271-1/+1
|
* Decrease kern.geom.mirror.timeout to 4, so it is smaller thanpjd2004-09-271-1/+1
| | | | vfs.root.mountdelay by default.
* Forgot to commit addition of ds_resync field.pjd2004-09-261-0/+1
|
* Avoid race while synchronizing components. It is very hard to bump into,pjd2004-09-261-8/+31
| | | | | | | | | 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
* Simplify code a bit.pjd2004-09-261-18/+9
|
* This is not needed anymore, it is forced in GEOM now.pjd2004-09-201-3/+0
| | | | | | | | | 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>
* Show current status of mirror device directly.pjd2004-09-081-0/+9
| | | | Suggested by: Krzysztof CiepĀ³ucha <kris@home.pl>
* Allow to configure debug level from /boot/loader.conf.pjd2004-08-301-0/+1
|
* GCC, ehh.pjd2004-08-291-0/+1
|
* Skip providers with not defined sector size.pjd2004-08-261-0/+3
| | | | Reported by: kuriyama
OpenPOWER on IntegriCloud