summaryrefslogtreecommitdiffstats
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* Add basic metadata integrity check. In case when partition table wasae2011-05-111-1/+48
| | | | | | | | probed and read successfull, but it contains invalid values (e.g. overlapped partitions, offset or size is out of bounds), then table will be rejected. MFC after: 1 month
* Limit number of sectors that can be addressed.ae2011-05-081-5/+2
| | | | MFC after: 1 week
* Limit number of sectors that can be addressed.ae2011-05-081-2/+2
| | | | MFC after: 1 week
* Limit number of sectors that can be addressed.ae2011-05-081-2/+5
| | | | Reject table if blkcount from metadata is greater than provider.
* Limit number of sectors that can be addressed.ae2011-05-081-2/+2
| | | | MFC after: 1 week
* Replace UINT_MAX to UINT32_MAX.ae2011-05-082-4/+4
| | | | | Pointed out by: kib MFC after: 1 week
* Limit number of sectors that can be addressed.ae2011-05-081-2/+2
| | | | MFC after: 1 week
* Limit number of sectors that can be addressed.ae2011-05-081-2/+2
| | | | MFC after: 1 week
* Export GELI class version via sysctl kern.geom.eli.version.pjd2011-05-081-0/+3
| | | | MFC after: 1 week
* Version 6 is compatible with version 5 when it comes to control commands.pjd2011-05-081-1/+6
| | | | MFC after: 1 week
* Detect and handle metadata of version 6.pjd2011-05-081-8/+9
| | | | MFC after: 1 week
* When support for multiple encryption keys was committed, GELI integrity modepjd2011-05-083-3/+26
| | | | | | | | | | | | | was not updated to pass CRD_F_KEY_EXPLICIT flag to opencrypto. This resulted in always using first key. We need to support providers created with this bug, so set special G_ELI_FLAG_FIRST_KEY flag for GELI provider in integrity mode with version smaller than 6 and pass the CRD_F_KEY_EXPLICIT flag to opencrypto only if G_ELI_FLAG_FIRST_KEY doesn't exist. Reported by: Anton Yuzhaninov <citrin@citrin.ru> MFC after: 1 week
* Remove prototype for a function that no longer exist.pjd2011-05-081-2/+0
| | | | MFC after: 1 week
* Drop proper key.pjd2011-05-081-1/+1
| | | | MFC after: 1 week
* Add magic field to the g_eli_key structure to detect if we are reallypjd2011-05-081-1/+13
| | | | | | operating on proper structures. MFC after: 1 week
* Updates to geom_map from the author.adrian2011-05-051-209/+246
| | | | | | | The major update here is to support 64 bit size/offsets. There's also style related changes. Submitted by: ray@dlink.ua
* Remove unneeded code.ae2011-05-041-30/+4
| | | | MFC after: 1 week
* Remove unneeded code.ae2011-05-041-14/+0
| | | | MFC after: 1 week
* Remove unneeded code.ae2011-05-041-28/+7
| | | | MFC after: 1 week
* Removed KASSERT, g_new_providerf() can not fail.ae2011-05-041-1/+0
| | | | MFC after: 1 week
* Remove "for a moment" assignment. struct g_geom zeroed when allocated.ae2011-05-044-8/+0
| | | | MFC after: 1 week
* Remove unneeded checks, g_new_xxx functions can not fail.ae2011-05-041-31/+6
| | | | MFC after: 1 week
* When checking existence of providers skip those which are orphaned.ae2011-05-041-0/+2
| | | | | PR: kern/132273 MFC after: 2 week
* Use make_dev_alias_p() added in r221397 to create alias dev entry.mav2011-05-031-1/+2
| | | | It removes panic in case if alias name is already busy for some reason.
* Implement relaxed comparision for hardcoded provider names to make itmav2011-04-279-10/+53
| | | | | ignore adX/adaY difference in both directions to simplify migration to the CAM-based ATA or back.
* - Add shim to simplify migration to the CAM-based ATA. For each new adaXmav2011-04-261-2/+26
| | | | | | | | | device in /dev/ create symbolic link with adY name, trying to mimic old ATA numbering. Imitation is not complete, but should be enough in most cases to mount file systems without touching /etc/fstab. - To know what behavior to mimic, restore ATA_STATIC_ID option in cases where it was present before. - Add some more details to UPDATING.
* One key is expected from providers smaller than or equal to (2^20)*sectorsizepjd2011-04-241-6/+0
| | | | | | | | bytes. Remove bogus assertion and while here remove another too obvious assertion. Reported by: Fabian Keil <freebsd-listen@fabiankeil.de> MFC after: 2 weeks
* If number of keys for the given provider doesn't exceed the limit,pjd2011-04-211-0/+20
| | | | | | | | allocate all of them at attach time. This allows to avoid moving keys around in the most-recently-used queue and needs no mutex synchronization nor refcounting. MFC after: 2 weeks
* Instead of allocating memory for all the keys at device attach,pjd2011-04-217-138/+386
| | | | | | | | | | | create reasonably large cache for the keys that is filled when needed. The previous version was problematic for very large providers (hundreds of terabytes or serval petabytes). Every terabyte of data needs around 256kB for keys. Make the default cache limit big enough to fit all the keys needed for 4TB providers, which will eat at most 1MB of memory. MFC after: 2 weeks
* Reduce geom_raid log verbosity.mav2011-04-181-1/+1
|
* Remove an incorrect be16toh() that prevented geom_part_apm from working ongavin2011-04-151-1/+1
| | | | | | | little-endian machines. Reviewed by: marcel MFC after: 2 weeks
* Introduce geom_map, a GEOM provider designed for use byadrian2011-04-121-0/+356
| | | | | | | | | | | | | | | | | | | | | embedded flash stores. Some devices - notably those with uboot - don't have an explicit partition table (eg like Redboot's FIS.) geom_map thus provides an easy way to export the hard-coded flash layout as geom providers for use by filesystems and other tools. It also includes a "search" function which allows for dynamic creation of partition layouts where the device only has a single hard-coded partition. For example, if there is a "kernel+rootfs" partition, a single image can be created which appends the rootfs after the kernel with an appropriate search string. geom_map can be told to search for said search string and create a partition beginning after it. Submitted by: Aleksandr Rybalko <ray@dlink.ua>
* In g_eli_read_done() and g_eli_write_done(), for a bio withtrociny2011-04-031-2/+2
| | | | | | | | | bio_children > 1, g_destroy_bio() is never called and the bio leaks. Fix this by calling g_destroy_bio() earlier, before the check. Submitted by: Victor Balada Diaz <victor@bsdes.net> (initial version) Approved by: pjd (mentor) MFC after: 1 week
* GEOM has an internal mechanism to deal with ENOMEM errors returned viapjd2011-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | g_io_deliver(). In such case it increases 'pace' counter on each ENOMEM and reschedules the request. The 'pace' counter is decreased for each request going down, but until 'pace' is greater than zero, GEOM will handle at most 10 requests per second. For GEOM GATE users that are proxy to local GEOM providers (like ggatel(8) and HAST) we can end up with almost permanent slow down of GEOM down queue. This is because once we reach GEOM GATE queue limit, we return ENOMEM to the GEOM. This means that we have, eg. 1024 I/O requests in the GEOM GATE queue. To make room in the queue and stop returning ENOMEM we need to proceed the requests of course, but those requests are handled by userland daemons that handle them by reading/writing also from/to local GEOM providers. For example with HAST, a new requests comes to /dev/hast/data, which is GEOM GATE provider. GEOM GATE passes the request to hastd(8) and hastd(8) reads/writes from/to /dev/da0. Once we reach GEOM GATE queue limit, to free up a slot in GEOM GATE queue, hastd(8) has to read/write from/to /dev/da0, but this request will also be very slow, because GEOM now slows down all the requests. We end up with full queue that we can unload at the speed of 10 requests per second. This simply looks like a deadlock. Fix it by allowing userland daemons that work with both GEOM GATE and local GEOM providers to specify unlimited queue size, so GEOM GATE will never return ENOMEM to the GEOM. MFC after: 1 week
* Bunch of small bugfixes and cleanups.mav2011-03-318-62/+32
| | | | Found with: Clang Static Analyzer
* Bunch of small bugfixes and cleanups.mav2011-03-316-29/+24
| | | | | | Found with: Coverity Prevent(tm) CID: 9656, 9658, 9693, 9705, 9706, 9707, 9808, 9809, 9810, 9711, 9712, 9713, 9714
* Remove unneeded checks, g_new_xxx functions can not return NULL.ae2011-03-311-26/+6
| | | | | Reviewed by: pjd MFC after: 1 week
* Increase debug level on g_gate device destruction and add message ontrociny2011-03-301-1/+2
| | | | | | | | device creation. Suggested by: danger Approved by: pjd (mentor) MFC after: 3 days
* In g_gate_create() there is a window between when g_gate_softc istrociny2011-03-272-2/+6
| | | | | | | | | | | | | | | registered in g_gate_units array and when its sc_provider field is filled. If during this period g_gate_units is accessed by another thread that is checking for provider name collision the crash is possible. Fix this by adding sc_name field to struct g_gate_softc. In g_gate_create() when g_gate_softc is created but sc_provider is still not sc_name points to provider name stored in the local array. Approved by: pjd (mentor) Reported by: Freddie Cash <fjwcash@gmail.com> MFC after: 1 week
* MFgraid/head:mav2011-03-2414-0/+15267
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new RAID GEOM class, that is going to replace ataraid(4) in supporting various BIOS-based software RAIDs. Unlike ataraid(4) this implementation does not depend on legacy ata(4) subsystem and can be used with any disk drivers, including new CAM-based ones (ahci(4), siis(4), mvs(4), ata(4) with `options ATA_CAM`). To make code more readable and extensible, this implementation follows modular design, including core part and two sets of modules, implementing support for different metadata formats and RAID levels. Support for such popular metadata formats is now implemented: Intel, JMicron, NVIDIA, Promise (also used by AMD/ATI) and SiliconImage. Such RAID levels are now supported: RAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT. For any all of these RAID levels and metadata formats this class supports full cycle of volume operations: reading, writing, creation, deletion, disk removal and insertion, rebuilding, dirty shutdown detection and resynchronization, bad sector recovery, faulty disks tracking, hot-spare disks. For Intel and Promise formats there is support multiple volumes per disk set. Look graid(8) manual page for additional details. Co-authored by: imp Sponsored by: Cisco Systems, Inc. and iXsystems, Inc.
* MFgraid/head r218212, r218257:mav2011-03-242-9/+96
| | | | | | | | | | | Introduce new type of BIO_GETATTR -- GEOM::setstate, used to inform lower GEOM about state of it's providers from the point of upper layers. Make geom_disk use led(4) subsystem to illuminate states in such fashion: FAILED - "1" (on), REBUILD - "f5" (slow blink), RESYNC - "f1" (fast blink), ACTIVE - "0" (off). LED name should be set for each disk via kern.geom.disk.%s.led sysctl. Later disk API could be extended to allow disk driver to report this info in custom way via it's own facilities.
* MFgraid/head r217827:mav2011-03-243-14/+15
| | | | | | | Change BIO_GETATTR("GEOM::kerneldump") API to make set_dumper() called by consumer (geom_dev) instead of provider (geom_disk). This allows any geom insert it's code into the dump call chain, implementing more sophisticated functionality then just disk partitioning.
* Some linux distros put mount point into the ext2fs labels, such as '/', orsobomax2011-03-081-4/+10
| | | | | | | | | | | | '/boot', which confuses the devfs code and can cause userland programs to fail reading /dev/ext2fs directory with weird error code, such as any program that uses pwlib. Strip any leading slashes before feeding the label to the geom_label code. Sponsored by: Sippy Software, Inc. MFC after: 1 week
* Add the disk ident and a human-meaningful description (here, the disk modelnwhitehorn2011-02-262-0/+3
| | | | | | | string) to the geom_disk config XML so that they are easily accessible from userland. MFC after: 1 week
* Add some FEATURE macros for various GEOM classes.netchild2011-02-2528-0/+68
| | | | | | | | | | | No FreeBSD version bump, the userland application to query the features will be committed last and can serve as an indication of the availablility if needed. Sponsored by: Google Summer of Code 2010 Submitted by: kibab Reviewed by: silence on geom@ during 2 weeks X-MFC after: to be determined in last commit with code from this project
* Fix typos - remove duplicate "the".brucec2011-02-213-3/+3
| | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
* Add support to set a slice name.nyan2011-02-191-11/+37
|
* Correct a subtle bug in the 'gsched_rr' disk scheduler.luigi2011-02-141-8/+20
| | | | | | | | | | | | | | | | | | | | | The algorithm is supposed to work as follows: in order to prevent starvation, when a new client starts being served we record the start time and reset the counter of bytes served. We then switch to a new client after a certain amount of time or bytes, even if the current one still has pending requests. To avoid charging a new client the time of the first seek, we start counting time when the first request is served. Unfortunately a bug in the previous version of the code failed to set the start time in certain cases, resulting in some processes exceeding their timeslice. The fix (in this patch) is trivial, though it took a while to find out and replicate the bug. Thanks to Tommaso Caprai for investigating and fixing the problem. Submitted by: Tommaso Caprai MFC after: 1 week
* Use the preload_fetch_addr() and preload_fetch_size() conveniencemarcel2011-02-131-13/+12
| | | | | | functions to obtain the address and size of the preloaded key files. Sponsored by: Juniper Networks.
* Add support to write boot menu.nyan2011-02-111-9/+17
|
OpenPOWER on IntegriCloud