summaryrefslogtreecommitdiffstats
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Add new user-friendly aliases for partition types for the MBR andae2011-01-285-28/+66
| | | | | | | | | | EBR schemes: fat32, ebr, linux-data, linux-raid, linux-swap and linux-lvm. Add bios-boot GUID and alias for the GPT scheme. It used by GRUB 2 loader. Also do sorting definitions of types in diskmbr.h and in g_part.c. PR: bin/120990, kern/147664 MFC after: 2 weeks
* While inspecting the disklabel check that start offset of partition isae2011-01-271-0/+3
| | | | | | | within provider's bounds. If not then reject this disklabel. Mark bbarea as NULL to do not free it again in destroy method. MFC after: 1 week
* Remove the CTLFLAG_NOLOCK as it seems to be both unused andmdf2011-01-261-1/+2
| | | | | | | | | | | | unfunctional. Wiring the user buffer has only been done explicitly since r101422. Mark the kern.disks sysctl as MPSAFE since it is and it seems to have been mis-using the NOLOCK flag. Partially break the KPI (but not the KBI) for the sysctl_req 'lock' field since this member should be private and the "REQ_LOCKED" state seems meaningless now.
* Treat async buffer writes from the gjournal switcher thread the same askib2011-01-261-0/+1
| | | | | | | | from syncer. We shall not sleep on running buffer space when suspending. Reproduced and tested by: pho PR: kern/154228 MFC after: 1 week
* Limit maximum number of GPT entries to 4k. It is most realistic valueae2011-01-181-15/+33
| | | | | | | | | | | and can prevent kernel memory exhausting when big value is specified from command line. Split reading and writing operation to several iteration to do not trigger KASSERT when data length is greater than MAXPHYS. PR: kern/144962, kern/147851 MFC after: 2 weeks
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.mdf2011-01-122-12/+12
| | | | Commit the geom piece.
* Sector size can not be greater than MAXPHYS. Since GRAID3 calculatesae2011-01-121-0/+4
| | | | | | | | sector size from user-specified block size, report to user about big blocksize. PR: kern/147851 MFC after: 1 week
* Sector size can not be greater than MAXPHYS.ae2011-01-121-0/+4
| | | | MFC after: 1 week
* Remove redundant check.ae2011-01-111-2/+1
| | | | MFC after: 1 week
* Round GNOP provider's mediasize to its sectorsize. This prevents KASSERTae2011-01-111-0/+2
| | | | | | | in g_io_request when geom classes doing tasting. PR: kern/147852 MFC after: 1 week
* Fix a memory overflow where the input length to g_gpt_utf8_to_utf16()mdf2011-01-071-2/+4
| | | | | | | | was specified incorrectly, causing the bzero to run past the end of a malloc(9)'d object. Submitted by: Eric Youngblut < eyoungblut AT isilon DOT com > MFC after: 3 days
* Add an entry to the gpart XML to determine if the geom has pending changesnwhitehorn2011-01-061-0/+2
| | | | | | that need to be committed (or undone). MFC after: 2 weeks
* Finish r210923, 210926. Mark some devices as eternal.kib2011-01-041-1/+1
| | | | MFC after: 2 weeks
* Add reporting of GEOM::candelete BIO_GETATTR for md(4) and geom_disk(4).kib2010-12-291-1/+5
| | | | | | | | Non-zero value of attribute means that device supports BIO_DELETE. Suggested and reviewed by: pjd Tested by: pho MFC after: 1 week
* Allow destroying EBR in COMPAT (default) mode.ae2010-12-281-0/+2
| | | | MFC after: 2 week
* Make EBR probe method less strictly to be able detect EBRs withae2010-12-281-21/+25
| | | | | | | | | | | small non fatal inconsistency. EBR may contain boot loader and sometimes it just has some garbage data. Now this does not prevent FreeBSD to use extended partitions. But since we do not support bootcode for EBR we mark tables which have non empty boot area as corrupt. This does make them readonly and we can not damage this data. PR: kern/141235 MFC after: 1 month
* Don't warn if a partition appears not to be aligned on a track boundary.brucec2010-12-071-6/+0
| | | | | Modern disks use LBA and create a fake CHS geometry that doesn't have any relation to the on-disk layout of data.
* Add a note about the magic number 20. Actually, 22.75 entries fit inivoras2010-12-021-1/+1
| | | | | | a 512 byte sector but when choosing magic numbers, 20 looks nicer. Discussed with: marcel
* - Report an error when a label with invalid name is attempted to bejh2010-12-011-4/+6
| | | | | | | | created with glabel(8). - Fix a typo in an error message. - Fix comment typos. Approved by: pjd
* Use g_eventlock to protect against losing wakeups in the g_event processjh2010-11-222-32/+37
| | | | | | | | | | | | | and replace tsleep(9) with msleep(9) which doesn't use a timeout. The previously used timeout caused the event process to wake up ten times per second on an idle system. one_event() is now called with the topology lock held and it returns with both the topology and event locks held when there are no more events in the queue. Reported by: mav, Marius NĂ¼nnerich Reviewed by: freebsd-geom
* Add support for asterisk characters when filling in the GELI passworded2010-11-141-2/+2
| | | | | | | | | | | during boot. Change the last argument of gets() to indicate a visibility flag and add definitions for the numerical constants. Except for the value 2, gets() will behave exactly the same, so existing consumers shouldn't break. We only use it in two places, though. Submitted by: lme (older version)
* Fix regression introduced in r215088: gpart(8) reportsae2010-11-111-6/+14
| | | | | | | | | | "arg0 'provider': Invalid argument" after creating new partition table. Move code for search of existing geom into g_part_find_geom function and use this function instead of g_part_parm_geom in g_part_ctl_create. Approved by: kib (mentor)
* In r212554 name of G_PART_PARM_GEOM and G_PART_PARM_PROVIDERae2010-11-101-1/+1
| | | | | | | ctlreq parameters was changed to "arg0". Fix the last place where it is used. Approved by: kib (mentor)
* Extend the g_eventlock mutex coverage in one_event() to include settingjh2010-11-031-4/+8
| | | | | | | | | of the EV_DONE flag and use the mutex to protect against losing wakeups in g_waitfor_event(). Reported by: davidxu Tested by: davidxu Discussed on: freebsd-current
* Reimplemented "gpart destroy -F". Now it does all work in kernel.ae2010-10-254-22/+168
| | | | | | | | | | | | | | | | | This was needed for recover implementation. Implement the recover command for GPT. Now GPT will marked as corrupt when any of three types of corruption will be detected: 1. Damaged primary GPT header or table 2. Damaged secondary GPT header or table 3. Secondary header is not located in the last LBA Marked GPT becomes read-only. Any changes with corrupt table are prohibited. Only "destroy" and "recover" commands are allowed. Discussed with: geom@ (mostly silence) Tested by: Ilya A. Arhipov Approved by: mav (mentor) MFC after: 2 weeks
* - Improve error messages, so instead of 'Not fully done', the user will getpjd2010-10-221-17/+21
| | | | | | | | information that device is already suspended or that device is using one-time key and suspend is not supported. - 'geli suspend -a' silently skips devices that use one-time key, this is fine, but because we log which device were suspended on the console, log also which devices were skipped.
* Close a race between checking if device is already suspended and suspending it.pjd2010-10-221-9/+9
|
* Add State tag, so 'geli status' will report active/suspended status, eg:pjd2010-10-221-0/+2
| | | | | | | # geli status Name Status Components da0.eli SUSPENDED da0 da1.eli ACTIVE da1
* Encryption keys array might be NULL if device is suspended. Check for this, sopjd2010-10-221-3/+6
| | | | we don't panic when we detach suspended device.
* Move sc_akeyctx and sc_ivctx initialization to the g_eli_mkey_propagate()pjd2010-10-223-42/+27
| | | | | function which eliminates code duplication and will ensure proper order of operation.
* Free opencrypto sessions on suspend, as they also might keep encryption keys.pjd2010-10-212-35/+81
|
* Fix a bug introduced in r213067 where we use authentication key beforepjd2010-10-211-9/+10
| | | | initializing it.
* Bring in geli suspend/resume functionality (finally).pjd2010-10-205-35/+379
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change if you wanted to suspend your laptop and be sure that your encryption keys are safe, you had to stop all processes that use file system stored on encrypted device, unmount the file system and detach geli provider. This isn't very handy. If you are a lucky user of a laptop where suspend/resume actually works with FreeBSD (I'm not!) you most likely want to suspend your laptop, because you don't want to start everything over again when you turn your laptop back on. And this is where geli suspend/resume steps in. When you execute: # geli suspend -a geli will wait for all in-flight I/O requests, suspend new I/O requests, remove all geli sensitive data from the kernel memory (like encryption keys) and will wait for either 'geli resume' or 'geli detach'. Now with no keys in memory you can suspend your laptop without stopping any processes or unmounting any file systems. When you resume your laptop you have to resume geli devices using 'geli resume' command. You need to provide your passphrase, etc. again so the keys can be restored and suspended I/O requests released. Of course you need to remember that 'geli suspend' won't clear file system cache and other places where data from your geli-encrypted file system might be present. But to get rid of those stopping processes and unmounting file system won't help either - you have to turn your laptop off. Be warned. Also note, that suspending geli device which contains file system with geli utility (or anything used by 'geli resume') is not very good idea, as you won't be able to resume it - when you execute geli(8), the kernel will try to read it and this read I/O request will be suspended.
* - Add missing comments.pjd2010-10-203-2/+14
| | | | - Make a comment consistent with others.
* Use make_dev_p(9) with the MAKEDEV_CHECKNAME flag instead of make_dev(9)jh2010-10-191-2/+10
| | | | | | | | | | and print a diagnostic if the call fails. This avoids a panic when a device with an invalid name is attempted to be registered. For example the label class gets device names from untrusted input. Reviewed by: freebsd-geom
* The canonical way to print __func__ when using KASSERT() is to writerpaulo2010-10-133-10/+11
| | | | ("%s", __func__). This avoids clang's -Wformat-string warnings.
* Replace strlen(_PATH_DEV) with sizeof(_PATH_DEV) - 1.ae2010-10-092-8/+8
| | | | | | Suggested by: kib Approved by: kib (mentor) MFC after: 5 days
* - Check flag with the bitwise operator, not the logical operator.lulf2010-10-012-4/+4
| | | | | Submitted by: arundel MFC after: 1 week
* Some schemes can allocate memory for internal purposes but whenae2010-09-253-0/+3
| | | | | | | | | | GEOM does withering this memory doesn't freed. Add G_PART_DESTROY call to g_part_wither. Also add missed g_free() call to G_PART_READ method for MBR and PC98 schemes. Submitted by: jh (previous version) Reviewed by: pjd Approved by: kib (mentor)
* Change g_eli_debug to int, so one can turn off any GELI output by settingpjd2010-09-252-3/+3
| | | | | | kern.geom.eli.debug sysctl to -1. MFC after: 2 weeks
* Ignore errors from BIO_FLUSH. It might confuse users that provider wasn'tpjd2010-09-251-8/+6
| | | | | | really killed. What we really care about are write errors only. MFC after: 2 weeks
* Allow to configure GPT attributes. It shouldn't be allowed to set bootfailedpjd2010-09-241-0/+85
| | | | | | | | attribute (it should be allowed only to unset it), but for test purposes it might be useful, so the current code allows it. Reviewed by: arch@ (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>) MFC after: 2 weeks
* Update copyright years.pjd2010-09-237-7/+7
| | | | MFC after: 1 week
* Add support for AES-XTS. This will be the default now.pjd2010-09-235-10/+73
| | | | MFC after: 1 week
* Implement switching of data encryption key every 2^20 blocks.pjd2010-09-235-55/+171
| | | | | | | This ensures the same encryption key won't be used for more than 2^20 blocks (sectors). This will be the default now. MFC after: 1 week
* Make the code similar to the code in g_eli_integrity.c.pjd2010-09-231-3/+4
| | | | MFC after: 1 week
* Define default overwrite count, so that userland can use it.pjd2010-09-232-1/+2
| | | | MFC after: 1 week
OpenPOWER on IntegriCloud