summaryrefslogtreecommitdiffstats
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* - 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
* When trashing metadata, flush after each write.pjd2010-09-231-0/+7
| | | | MFC after: 1 week
* Support attaching version 4 metadatabrian2010-09-191-2/+4
| | | | Reviewed by: pjd
* Add support for dumping kernel to gconcat.mav2010-09-161-0/+38
| | | | Dumping goes to the component, where dump partition begins.
* Change message when setting or unsetting attribute less confusing.pjd2010-09-151-2/+3
| | | | | | | | | | | | Before: ada0 has <attrib> set After: <attrib> set on ada0 MFC after: 2 weeks
* Make the message that informs about bootcode being written to disk lesspjd2010-09-151-2/+2
| | | | | | | | | | | | | | | confusing. Note there is still no information about 'partcode' being written to disk (gpart bootcode -p <partcode> <disk>). Maybe in the future all the messages printed by gpart(8) on success could be hidden under -v? PR: bin/150239 Reported by: Roddi <roddi@me.com> Submitted by: arundel MFC after: 2 weeks
* - Change all places where G_TYPE_ASCNUM is used to G_TYPE_NUMBER.pjd2010-09-141-55/+118
| | | | | It turns out the new type wasn't really needed. - Reorganize code a little bit.
* Simplify the code a bit.pjd2010-09-141-12/+8
|
* - Remove gc_argname field. It was introduced for gpart(8), but if Ipjd2010-09-131-8/+4
| | | | | | | understand everything correctly, we don't really need it. - Provide default numeric value as strings. This allows to simplify a lot of code. - Bump version number.
* - Allow to specify value as const pointers.pjd2010-09-132-3/+3
| | | | - Make optional string values always an empty string.
* Correct bioq_disksort so that bioq_insert_tail() offers barrier semantic.gibbs2010-09-022-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the BIO_ORDERED flag for struct bio and update bio clients to use it. The barrier semantics of bioq_insert_tail() were broken in two ways: o In bioq_disksort(), an added bio could be inserted at the head of the queue, even when a barrier was present, if the sort key for the new entry was less than that of the last queued barrier bio. o The last_offset used to generate the sort key for newly queued bios did not stay at the position of the barrier until either the barrier was de-queued, or a new barrier (which updates last_offset) was queued. When a barrier is in effect, we know that the disk will pass through the barrier position just before the "blocked bios" are released, so using the barrier's offset for last_offset is the optimal choice. sys/geom/sched/subr_disk.c: sys/kern/subr_disk.c: o Update last_offset in bioq_insert_tail(). o Only update last_offset in bioq_remove() if the removed bio is at the head of the queue (typically due to a call via bioq_takefirst()) and no barrier is active. o In bioq_disksort(), if we have a barrier (insert_point is non-NULL), set prev to the barrier and cur to it's next element. Now that last_offset is kept at the barrier position, this change isn't strictly necessary, but since we have to take a decision branch anyway, it does avoid one, no-op, loop iteration in the while loop that immediately follows. o In bioq_disksort(), bypass the normal sort for bios with the BIO_ORDERED attribute and instead insert them into the queue with bioq_insert_tail(). bioq_insert_tail() not only gives the desired command order during insertion, but also provides barrier semantics so that commands disksorted in the future cannot pass the just enqueued transaction. sys/sys/bio.h: Add BIO_ORDERED as bit 4 of the bio_flags field in struct bio. sys/cam/ata/ata_da.c: sys/cam/scsi/scsi_da.c Use an ordered command for SCSI/ATA-NCQ commands issued in response to bios with the BIO_ORDERED flag set. sys/cam/scsi/scsi_da.c Use an ordered tag when issuing a synchronize cache command. Wrap some lines to 80 columns. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c sys/geom/geom_io.c Mark bios with the BIO_FLUSH command as BIO_ORDERED. Sponsored by: Spectra Logic Corporation MFC after: 1 month
* Correct offset conversion to little endian. It was implemented in version 2,pjd2010-08-282-7/+9
| | | | | | | | but because of a bug it was a no-op, so we were still using offsets in native byte order for the host. Do it properly this time, bump version to 4 and set the G_ELI_FLAG_NATIVE_BYTE_ORDER flag when version is under 4. MFC after: 2 weeks
* Remove bintime_cmp() function, unused since r200086.mav2010-08-181-15/+0
| | | | MFC after: 1 week
* Check that gsp is not NULL before access. It can be NULLae2010-08-031-1/+1
| | | | | | | for some cases. Approved by: kib (mentor) MFC after: 1 week
* Check that table is not NULL before access, it can be NULLae2010-08-031-1/+1
| | | | | | | for some cases. Approved by: mav (mentor) MFC after: 2 weeks
* Forward ioctl requests to original geom.ae2010-08-021-0/+19
| | | | | | | | PR: 148540 Silence from: luigi Reviewed by: pjd Approved by: mav (mentor) MFC after: 2 weeks
* Release access for consumers that are opened, but will be destroyedae2010-08-021-0/+4
| | | | | | | | | indirectly by orphan method. PR: 148688 Silence from: marcel Approved by: mav (mentor) MFC after: 2 weeks
* Export PCI IDs of ATA/SATA controllers through CAM and ata(4) layers tomav2010-07-252-0/+16
| | | | | GEOM. This information needed for proper soft-RAID's on-disk metadata reading and writing.
* Prevent access after free to table entry in case whenae2010-07-231-8/+8
| | | | | | | | | user deletes partition that not yet created (changes doesn't committed to disk). PR: 148687 Approved by: mav (mentor) MFC after: 7 days
* Fixed cache size decoding read from a label.ru2010-07-141-1/+1
| | | | | | PR: kern/144732 Submitted by: Eugene Grosbein MFC after: 3 days
* Add NTFS partition type to GEOM_MBR.rpaulo2010-06-263-2/+14
|
* 'unit' can be negative, so use signed type for it.pjd2010-06-141-1/+1
| | | | | | Found by: Coverity Prevent CID: 3731 MFC after: 3 days
* BIO_DELETE contains range we want to delete and doesn't provide any usefulpjd2010-06-141-1/+1
| | | | | | data, so there is no need to copy it to userland. MFC after: 3 days
* fix a few cases where a string is passed via format argument instead ofavg2010-06-111-1/+1
| | | | | | | | | | via %s Most of the cases looked harmless, but this is done for the sake of correctness. In one case it even allowed to drop an intermediate buffer. Found by: clang MFC after: 2 week
* Untangle g_print_bio(), silencing Coverity.trasz2010-06-101-8/+7
| | | | | Found with: Coverity Prevent CID: 3566, 3567
* Try and narrow the gap in which you act on an event that has been canceled.mjacob2010-06-081-0/+10
| | | | | Obtained from: Jaako Heinonen MFC after: 1 month
* Make sure not to pass NULL to g_orphan_provider().trasz2010-06-051-1/+2
| | | | | Found with: Coverity Prevent CID: 3411
* Don't leak memory on destruction.marius2010-06-022-0/+12
| | | | | Reviewed by: marcel MFC after: 3 days
* g_label: fix possible NULL pointer dereferenceavg2010-05-311-4/+2
| | | | | | | | in case glabel debug level is >= 1 and gp->provider list is empty for some reason Found by: clang static analyzer MFC after: 4 days
OpenPOWER on IntegriCloud