summaryrefslogtreecommitdiff
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* MFC: r267145Marius Strobl2014-06-251-1/+1
| | | | | | | | | | | | | Fix the keyfile being cleared prematurely after r259428 (MFCed to stable/9 in r266750). PR: 185084 Submitted by: fk@fabiankeil.de Reviewed by: pjd Approved by: re (glebius) Notes: svn path=/releng/9.3/; revision=267862
* MFC r266880:Andrey V. Elsukov2014-06-063-8/+16
| | | | | | | | | | Use g_conf_printf_escaped() to escape symbols, which can break an XML tree. Approved by: re (gjb) Notes: svn path=/stable/9/; revision=267157
* MFC: r259428Marius Strobl2014-05-272-0/+3
| | | | | | | | | | | | | Clear content of keyfiles loaded by the loader after processing them. MFC: r259429 Clear some more places with potentially sensitive data. Approved by: re (gjb) Notes: svn path=/stable/9/; revision=266750
* MFC r265072:Bryan Drewery2014-05-141-1/+0
| | | | | | | Remove redundant include Notes: svn path=/stable/9/; revision=266037
* MFC r264499:Bryan Drewery2014-05-141-2/+3
| | | | | | | Make g_access() KASSERT() more useful. Notes: svn path=/stable/9/; revision=266034
* MFC r265318:Andrey V. Elsukov2014-05-125-84/+117
| | | | | | | | | | | | | | | | | | | For schemes that do an automatic partition aligning move this code to separate function. MFC r265331: Prevent an unexpected shrinking on resizing due to alignment for MBR, PC98 and VTOC8 schemes. MFC r265333: Add better error description for case when we are doing resize and scheme-specific method returns EBUSY. MFC r265539: It is safe to allow shrinking, when aligned size is bigger than current. Notes: svn path=/stable/9/; revision=265911
* MFC r264313:Alexander Motin2014-05-081-3/+10
| | | | | | | | | Do not increment bio_data in case of BIO_DELETE. This fixes KASSERT() panic in g_io_request(). Notes: svn path=/stable/9/; revision=265676
* MFC r265054:Alexander Motin2014-05-087-20/+25
| | | | | | | | | | | Reduce number of opens by REOM RAID during provider taste. Instead opening/closing provider by each of metadata classes, do it only once in core code. Since for SCSI disks open/close means sending some SCSI commands to the device, this change reduces taste time. Notes: svn path=/stable/9/; revision=265675
* MFC r256607, r259247:Alexander Motin2014-05-081-5/+5
| | | | | | | Fix passing uninitialized bio_resid argument to g_trace(). Notes: svn path=/stable/9/; revision=265674
* MFC r256610:Alexander Motin2014-05-087-61/+90
| | | | | | | Add unmapped I/O support to GEOM RAID. Notes: svn path=/stable/9/; revision=265673
* MFC r256606:Alexander Motin2014-05-081-3/+4
| | | | | | | | Move g_io_deliver() out of the lock, as required for direct dispatch. Move g_destroy_bio() out too to reduce lock scope even more. Notes: svn path=/stable/9/; revision=265672
* MFC r256603:Alexander Motin2014-05-082-3/+8
| | | | | | | | | Introduce new function devstat_end_transaction_bio_bt(), adding new argument to specify present time. Use this function to move binuptime() out of lock, substantially reducing lock congestion when slow timecounter is used. Notes: svn path=/stable/9/; revision=265671
* MFC r254252:Alexander Motin2014-05-081-2/+2
| | | | | | | | | | Fix the formatting of the error message. The G_MIRROR_DEBUG() macro already appends a newline. Also, most of the log messages emitted by gmirror start with an uppercase letter. Notes: svn path=/stable/9/; revision=265670
* MFC r264318:Alexander Motin2014-04-241-17/+39
| | | | | | | | | | | Fix wrong sizes used to access PD_Type and PD_State DDF metadata fields. This caused incorrect behavior of arrays with big-endian DDF metadata. Little-endian (like used by Adaptec controllers) should not be harmed. Add workaround should be enough to manage compatibility. Notes: svn path=/stable/9/; revision=264869
* MFC r264142:Bryan Drewery2014-04-211-1/+2
| | | | | | | Show error code when failing to destroy a mirror on delay Notes: svn path=/stable/9/; revision=264715
* MFC r264320:Bryan Drewery2014-04-211-1/+1
| | | | | | | Fix spelling error in g_trace() call. Notes: svn path=/stable/9/; revision=264714
* MFC r261618:Xin LI2014-02-221-0/+1
| | | | | | | | | | | | | | | | In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom <serge vdboom.org> Reviewed by: pjd Notes: svn path=/stable/9/; revision=262319
* MFC r260883:Alexander Motin2014-02-021-1/+0
| | | | | | | | Remove unneeded and dangerous assignment. It would probably cause NULL refererence panic if compiler not optimize it out. Notes: svn path=/stable/9/; revision=261392
* MFC r261084:Andrey V. Elsukov2014-01-301-33/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | malloc() with M_WAITOK doesn't return NULL. MFC r261085: Fix typo in r261084. Add to the gctl_error() an ability to specify error description even if numeric error code is already specified. Also by default set error code to EINVAL. PR: 185852 MFC r261086: In gctl_copyin() remove unused error variable. geom_alloc_copyin() can't return ENOMEM, so describe its fail as bad control request. Add check for NULL pointer in gctl_dump(), since it can be NULL when geom_alloc_copyin() failed. MFC r261089: Remove another unneeded NULL check from geom_alloc_copyin(). Do copyout in case of gctl version mismatch and fix sbuf leak in g_ctl_ioctl_ctl(). MFC r261091: Always free sbuf in gctl_free(). Notes: svn path=/stable/9/; revision=261286
* MFC r259925-259926:Dmitry Morozovsky2014-01-213-0/+4
| | | | | | | | | Add GPT UUID for VMware vSAN meta-data partition. Approved by: ae Notes: svn path=/stable/9/; revision=260981
* MFC r259634:Andrey V. Elsukov2014-01-103-5/+25
| | | | | | | | | | | | | | | | | | | | | Prevent users from deactivating the last component of a mirror. MFC r259929: Add an ability to stop gmirror and clear its metadata in one command. This fixes the problem, when gmirror starts again just after stop. The problem occurs when gmirror's component has geom label with equal size. E.g. gpt and gptid have the same size as partition, diskid has the same size as entire disk. When gmirror's geom has been destroyed, glabel creates its providers and this initiate retaste. Now "gmirror destroy" command is available. It destroys geom and also erases gmirror's metadata. PR: 184985 Notes: svn path=/stable/9/; revision=260507
* MFC r258683:Alexander Motin2014-01-093-22/+42
| | | | | | | Escape special XML chars, returned by some devices, confusing XML parsers. Notes: svn path=/stable/9/; revision=260480
* MFC r257965:Andrey V. Elsukov2013-12-141-2/+2
| | | | | | | | | Add missing line breaks. PR: 181900 Notes: svn path=/stable/9/; revision=259384
* MFC r257539:Xin LI2013-11-051-4/+4
| | | | | | | | | | | | | | | | | | | When zero'ing out a buffer, make sure we are using right size. Without this change, in the worst but unlikely case scenario, certain administrative operations, including change of configuration, set or delete key from a GEOM ELI provider, may leave potentially sensitive information in buffer allocated from kernel memory. We believe that it is not possible to actively exploit these issues, nor does it impact the security of normal usage of GEOM ELI providers when these operations are not performed after system boot. Security: possible sensitive information disclosure Submitted by: Clement Lecigne <clecigne google com> Notes: svn path=/stable/9/; revision=257719
* MFC r255144:Alexander Motin2013-09-141-10/+12
| | | | | | | | | | | Make ELI destruction (including orphanization) less aggressive, making it always wait for provider close. Old algorithm was reported to cause NULL dereference panic on attempt to close provider after softc destruction. If not global workaroung in GEOM, that could even cause destruction with requests still in flight. Notes: svn path=/stable/9/; revision=255568
* MFC r254936:Alexander Motin2013-09-141-4/+28
| | | | | | | Add unmapped BIO support to GEOM ZERO if kern.geom.zero.clear is cleared. Notes: svn path=/stable/9/; revision=255567
* MFC r254275:Alexander Motin2013-09-143-1/+8
| | | | | | | | Return error when opening read-only volumes (like RAID4/5/...) for writing. Previously opens succeeded, but actual write operations returned errors. Notes: svn path=/stable/9/; revision=255565
* MFC r254269, r254271:Alexander Motin2013-09-141-2/+6
| | | | | | | Fix reasonable but safe Clang warnings. Notes: svn path=/stable/9/; revision=255564
* MFC r253706:Alexander Motin2013-09-142-11/+8
| | | | | | | | | Introduce 3 seconds timeout on `graid stop` command (mostly with -f flag). Since completion waiting goes in g_event thread, it may cause GEOM deadlock if consumer on top (for example, ZFS) uses g_event thread for closing. Notes: svn path=/stable/9/; revision=255563
* MFC r254766:Alexander Motin2013-09-141-0/+6
| | | | | | | | | Add new attribute lunname to report only textual LUN-specific device IDs. While lunid attribute prefers to report numeric ones, having both may be useful in some situations. Notes: svn path=/stable/9/; revision=255556
* MFC r251587 (by marcel):Andrey V. Elsukov2013-08-296-46/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove stub implementation. MFC r251588 (by marcel): Change the set and unset ctlreqs by making the index argument optional. This allows setting attributes on tables. One simply does not provide an index in that case. Otherwise the entry corresponding the index has the attribute set or unset. Use this change to fix a relatively longstanding bug in our GPT scheme that's the result of rev 198097 (relatively harmless) followed by rev 237057 (damaging). The damaging part being that our GPT scheme always has the active flag set on the PMBR slice. This is in violation with EFI. Existing EFI implementions for both x86 and ia64 reject the GPT. As such, GPT disks created by us aren't usable under EFI because of that. After this change, GPT disks never have the active flag set on the PMBR slice. In order to make the GPT disk bootable under some x86 BIOSes, the reason of rev 198097, one must now set the active attribute on the gpt table. The kernel will apply this to the PMBR slice For (S)ATA: gpart set -a active ada0 To fix an existing GPT disk that has the active flag set in the PMBR, and that does not need the flag, use (again for (S)ATA): gpart unset -a active ada0 The EBR, MBR & PC98 schemes, which also impement at least 1 attribute, now check to make sure the entry passed is valid. They do not have attributes that apply to the table. Notes: svn path=/stable/9/; revision=255017
* MFC change 254389:Kenneth D. Merry2013-08-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some slight differences from the version in FreeBSD/head. __FreeBSD_version has been bumped to 902503 for the availability of the SI_UNMAPPED cdev flag, and the D_UNMAPPED_IO cdevsw flag remains in place. D_UNMAPPED_IO no longer does anything. Drivers that use that flag will just wind up having mapped I/O by default. The impact will only be on performance, not functionality. Change the way that unmapped I/O capability is advertised. The previous method was to set the D_UNMAPPED_IO flag in the cdevsw for the driver. The problem with this is that in many cases (e.g. sa(4)) there may be some instances of the driver that can handle unmapped I/O and some that can't. The isp(4) driver can handle unmapped I/O, but the esp(4) driver currently cannot. The cdevsw is shared among all driver instances. So instead of setting a flag on the cdevsw, set a flag on the cdev. This allows drivers to indicate support for unmapped I/O on a per-instance basis. sys/conf.h: Remove the D_UNMAPPED_IO cdevsw flag and replace it with an SI_UNMAPPED cdev flag. kern_physio.c: Look at the cdev SI_UNMAPPED flag to determine whether or not a particular driver can handle unmapped I/O. geom_dev.c: Set the SI_UNMAPPED flag for all GEOM cdevs. Since GEOM will create a temporary mapping when needed, setting SI_UNMAPPED unconditionally will work. Remove the D_UNMAPPED_IO flag. nvme_ns.c: Set the SI_UNMAPPED flag on cdevs created here if NVME_UNMAPPED_BIO_SUPPORT is enabled. vfs_aio.c: In aio_qphysio(), check the SI_UNMAPPED flag on a cdev instead of the D_UNMAPPED_IO flag on the cdevsw. sys/param.h: Bump __FreeBSD_version to 1000045 for the switch from setting the D_UNMAPPED_IO flag in the cdevsw to setting SI_UNMAPPED in the cdev. Reviewed by: kib, jimharris Sponsored by: Spectra Logic Notes: svn path=/stable/9/; revision=254979
* MFC r226840: AESNI-related commit, from a long time ago:Ollivier Robert2013-08-252-12/+5
| | | | | | | | | | | | | | | | | | | | | | Before this change when GELI detected hardware crypto acceleration it will start only one worker thread. For software crypto it will start by default N worker threads where N is the number of available CPUs. This is not optimal if hardware crypto is AES-NI, which uses CPU for AES calculations. Change that to always start one worker thread for every available CPU. Number of worker threads per GELI provider can be easly reduced with kern.geom.eli.threads sysctl/tunable and even for software crypto it should be reduced when using more providers. While here, when number of threads exceeds number of CPUs avilable don't reduce this number, assume the user knows what he is doing. Submitted by: Michael Moll <kvedulv@kvedulv.de> Notes: svn path=/stable/9/; revision=254859
* MFC r254095:Andrey V. Elsukov2013-08-221-2/+3
| | | | | | | | | | gpt_entries is used as limit for the number of partition entries in the GEOM_PART. Instead of just using number of entries from the GPT header, calculate this limit based on the reserved space between GPT header and first available LBA. Notes: svn path=/stable/9/; revision=254641
* MFC r253141:Konstantin Belousov2013-07-171-1/+3
| | | | | | | | | | When panicing due to the gjournal overflow, print the geom metadata journal id. Approved by: re (rodrigc) Notes: svn path=/stable/9/; revision=253415
* MFC r249940:Steven Hartland2013-07-042-7/+30
| | | | | | | | | | | | | | | | Teach GEOM and CAM about the difference between the max "size" of r/w and delete requests. MFC r252657: Bump disk(9) ABI version to signify the addition of d_delmaxsize. Make the addition of the d_delmaxsize binary compatible. This allows storage drivers compiled for 9.0 and 9.1 to work by preserving the ABI for disks. Reviewed by: mav Notes: svn path=/stable/9/; revision=252730
* MFC r252010, r252011:Scott Long2013-06-211-5/+18
| | | | | | | | | Mark geom_mirror as capable of unmapped i/o Obtained from: Netflix Notes: svn path=/stable/9/; revision=252063
* MFC r248712:Scott Long2013-06-181-1/+1
| | | | | | | | | | Do not pass unmapped buffers to drivers that cannot handle them Submitted by: kan, mav Obtained from: Netflix Notes: svn path=/stable/9/; revision=251942
* MFC r251616:Alexander Motin2013-06-181-0/+2
| | | | | | | | | Don't update provider properties and don't set DISKFLAG_OPEN if d_open() disk method call returned error. GEOM considers devices in such case as still closed, and won't call symmetric d_close() for them. Notes: svn path=/stable/9/; revision=251931
* MFC r249974:Alexander Motin2013-06-181-0/+4
| | | | | | | | Return "descr" field alike to "Intel RAID1 volume" for GEOM RAID to make it look better in bsdinstall. Notes: svn path=/stable/9/; revision=251929
* MFC r249193 (by trasz):Alexander Motin2013-06-181-1/+2
| | | | | | | | Make it possible to submit FLUSH bios through geom_dev strategy. This is required for CTL to work with device-backed LUNs. Notes: svn path=/stable/9/; revision=251927
* MFC r248722:Alexander Motin2013-06-181-0/+8
| | | | | | | | | geom_slice.c and its consumers like GEOM_LABEL are not touching the data unless hotspots are used. Pass G_PF_ACCEPT_UNMAPPED flag through except such rare cases (obsolete GEOM_SUNLABEL and GEOM_BSD). Notes: svn path=/stable/9/; revision=251925
* MFC r248721:Alexander Motin2013-06-181-0/+1
| | | | | | | GEOM NOP does not touch the data, so pass G_PF_ACCEPT_UNMAPPED flag through. Notes: svn path=/stable/9/; revision=251924
* MFC r248720:Alexander Motin2013-06-183-6/+0
| | | | | | | | Remove extra bio_data and bio_length copying to child request after calling g_clone_bio(), that already copied them. Notes: svn path=/stable/9/; revision=251922
* MFC r248696:Alexander Motin2013-06-181-0/+2
| | | | | | | | Make GEOM MULTIPATH to report unmapped bio support if underling path report it. GEOM MULTIPATH itself never touches the data and so transparent. Notes: svn path=/stable/9/; revision=251921
* MFC r248596 (by kib):Alexander Motin2013-06-181-0/+9
| | | | | | | Correct the page count when excess length is trimmed from the bio. Notes: svn path=/stable/9/; revision=251920
* MFC r248295 (by pjd):Alexander Motin2013-06-181-1/+1
| | | | | | | | We don't need buffer to handle BIO_DELETE, so don't check buffer size for it. This fixes handling BIO_DELETE larger than MAXPHYS. Notes: svn path=/stable/9/; revision=251918
* MFC r248068 (by sbruno):Alexander Motin2013-06-181-0/+22
| | | | | | | | | | | | | | | Add legacy support to geom raid to create a /dev/arX device for support of upgrading older machines using ataraid(4) to newer releases. This optional parameter is controlled via kern.geom.raid.legacy_aliases and will create a /dev/ar0 device that will point at /dev/raid/r0 for example. Tested on Dell SC 1425 DDF-1 format software raid controllers installing from stable/7 and upgrading to stable/9 without having to adjust /etc/fstab Notes: svn path=/stable/9/; revision=251916
* Merge the second part of the unmapped I/O changes. This enables theScott Long2013-06-186-6/+133
| | | | | | | | | | | | | | | infrastructure in the block layer and UFS filesystem as well as a few drivers. The list of MFC revisions is long, so I won't quote changelogs. r248508,248510,248511,248512,248514,248515,248516,248517,248518, 248519,248520,248521,248550,248568,248789,248790,249032,250936 Submitted by: kib Approved by: kib Obtained from: Netflix Notes: svn path=/stable/9/; revision=251897
* MFC r251654, r251664:Alexander Motin2013-06-171-1/+24
| | | | | | | | | | | | | | | | | | | Make CAM return and GEOM DISK pass through new GEOM::lunid attribute. SPC-4 specification states that serial number may be property of device, but not a specific logical unit. People reported about FC storages using serial number in that way, making it unusable for purposes of LUN multipath detection. SPC-4 states that designators associated with logical unit from the VPD page 83h "Device Identification" should be used for that purpose. Report first of them in the new attribute in such preference order: NAA, EUI-64, T10 and SCSI name string. While there, make GEOM DISK properly report GEOM::ident in XML output also using d_getattr() method, if available. This fixes serial numbers reporting for SCSI disks in `geom disk list` output and confxml. Notes: svn path=/stable/9/; revision=251849