summaryrefslogtreecommitdiffstats
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* Turn off kern.geom.part.mbr.enforce_chs by default.ae2014-08-121-2/+2
|
* Add sysctl and loader tunable kern.geom.part.mbr.enforce_chs that is setae2014-08-121-0/+10
| | | | | | | | by default. It can be used to disable automatic alignment to CHS geometry, that GEOM_PART_MBR does. Reviewed by: wblock MFC after: 1 week
* cswitch is unsigned, so don't compare it < 0. Any negative numbersimp2014-08-071-1/+1
| | | | will look huge and be caught by > 100.
* Unsigned values can never be less than 0.imp2014-08-071-1/+1
|
* In r264504, we prevented doing I/O for more than MAXPHYS by makingmarcel2014-07-221-158/+177
| | | | | | | | | | | | the assumption that consumers would respect bio_completed and/or bio_resid to detect short reads. This assumption proved false and file corruption was the result. Create as many bios as we need to satisfy the original request. Check the cached chunk every time we need to do I/O to increase the hit rate. Obtained from: junipre Networks, Inc. MFC after: 1 week
* After EFI support was added to the installer, it needed to allow bootnwhitehorn2014-07-045-6/+5
| | | | | | | | | | | | | partitions of types other than "freebsd-boot" (in particular, "efi"). This allows the removal of some nasty hacks for supporting PowerPC systems, in particular aliasing freebsd-boot to apple-boot on APM and an IBM-specific code on MBR. This changes the installer to use the correct names, which also breaks a degeneracy in the meaning of "freebsd-boot" that allows the addition of support for some newer IBM systems that can boot from GPT in addition to MBR. Since I have no idea how to detect which those systems are, leave the default on IBM PPC systems as MBR for now.
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-2822-141/+60
|
* Revert r267961, r267973:gjb2014-06-2722-60/+141
| | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-2722-141/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies
* Add disklabel64 support to GEOM_PART class.ae2014-06-111-0/+667
| | | | | | | | | | | | | | This partitioning scheme is used in DragonFlyBSD. It is similar to BSD disklabel, but has the following improvements: * metadata has own dedicated place and isn't accessible through partitions; * all offsets are 64-bit; * supports 16 partitions by default (has reserved place for more); * has reserved place for backup label (but not yet implemented); * has UUIDs for partitions and partition types; No objections from: geom MFC after: 2 weeks Relnotes: yes
* Allow swapping to DragonFlyBSD's swap partition.ae2014-06-111-1/+2
| | | | MFC after: 2 weeks
* Add aliases for DragonFlyBSD's partition types.ae2014-06-114-24/+57
| | | | MFC after: 2 weeks
* - Fix the keyfile being cleared prematurely after r259428brd2014-06-061-1/+1
| | | | | | PR: 185084 Submitted by: fk@fabiankeil.de Reviewed by: pjd@
* Use g_conf_printf_escaped() to escape symbols, which can breakae2014-05-303-8/+16
| | | | | | an XML tree. MFC after: 1 week
* Add a topology trace to the g_spoil_event.ae2014-05-191-0/+2
| | | | MFC after: 1 week
* We have two functions from where a geom orphan method could be called:ae2014-05-191-0/+8
| | | | | | | | | | | g_orphan_register and g_resize_provider_event. Both are called from the event queue. Also we have GEOM_DEV class, which does deferred destroy for its consumers via g_dev_destroy (also called from the event queue). So it is possible, that for some consumers an orphan method will be called twice. This triggers panic in g_dev_orphan. Check that consumer isn't already orphaned before call orphan method. MFC after: 2 weeks
* Make GEOM DISK to account also BIO_FLUSH operations.mav2014-05-171-2/+5
|
* It is safe to allow shrinking, when aligned size is bigger than current.ae2014-05-073-4/+4
| | | | | Tested by: jmg MFC after: 1 week
* Make r242379 - the fix for UFS labels disappearing after resizingtrasz2014-05-051-2/+4
| | | | | | | | the provider - also apply to UFS1 filesystems. This should help with resizing filesystems created by makefs(8), which still uses UFS1. Tested by: jmg@ Sponsored by: The FreeBSD Foundation
* Add an advice what to do when partition was automatically resized.ae2014-05-041-2/+4
| | | | X-MFC after: r256690
* Add better error description for case when we are doing resize andae2014-05-041-1/+3
| | | | | | scheme-specific method returns EBUSY. MFC after: 1 week
* Prevent an unexpected shrinking on resizing due to alignment for MBR,ae2014-05-043-3/+18
| | | | | | | PC98 and VTOC8 schemes. Reported by: jmg MFC after: 1 week
* For schemes that do an automatic partition aligning move this code toae2014-05-044-80/+93
| | | | | | separate function. MFC after: 1 week
* Fix a leak in g_uzip_taste(). After retrieve all the block offsets fromloos2014-05-011-0/+1
| | | | the uzip image, free the last data read.
* Actually the FEATURE() macro is defined on sys/sysctl.h.loos2014-05-011-0/+1
| | | | Pointyhat to: loos
* Some style and whitespace fixes. Reduce the difference between geom_uzip(4)loos2014-05-012-49/+42
| | | | | | | | | and geom_uncompress(4). Now, they produce an almost clean diff(1) output. Remove a duplicated variable from g_uncompress.c and an unnecessary header from g_uzip.c. No functional changes.
* Remove redundant includebdrewery2014-04-291-1/+0
| | | | MFC after: 3 days
* Reduce number of opens by REOM RAID during provider taste.mav2014-04-287-20/+25
| | | | | | | | | 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. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
* Keep geom_uncompress(4) in line with geom_uzip(4), bring in the r264504 fix.loos2014-04-221-5/+23
| | | | | | | | | | | | | | | | Make sure not to start I/O bigger than MAXPHYS bytes. Quoting r264504: When we detect the condition, we'll reduce the block count and perform a "short" read. In g_uncompress_done() we need to consider the original I/O length and stop early if we're about to deflate a block that we didn't read. By using bio_completed in the cloned BIO and not bio_length to check for this, we automatically and gracefully handle short reads that our providers may be doing on top of the short reads we may initiate ourselves. Reviewed by: marcel
* Make sure not to do I/O for more than MAXPHYS bytes. Doing so can causemarcel2014-04-151-5/+22
| | | | | | | | | | | | | | | | | | | problems in our providers, such as a KASSERT in md(4). We can initiate I/O for more than MAXPHYS bytes if we've been given a BIO for MAXPHYS bytes, the blocks from which we're reading couldn't be compressed and we had compression in preceeding blocks resulting in misalignment of the blocks we're trying to read relative to the sector. We're forced to round up the I/O length to make it an multiple of the sector size. When we detect the condition, we'll reduce the block count and perform a "short" read. In g_uzip_done() we need to consider the original I/O length and stop early if we're about to deflate a block that we didn't read. By using bio_completed in the cloned BIO and not bio_length to check for this, we automatically and gracefully handle short reads that our providers may be doing on top of the short reads we may initiate ourselves. Obtained from: Juniper Networks, Inc.
* Make g_access() KASSERT() more useful.bdrewery2014-04-151-2/+3
| | | | | | Sponsored by: EMC / Isilon Storage Division Obtained from: Isilon OneFS MFC after: 2 weeks
* Align and round the partitionable disk space to 4K by default.marcel2014-04-121-6/+29
| | | | | | Since this would also apply when recovering, make sure not to align or round when that would have a partition fall outside the partitionable area.
* Fix spelling error in g_trace() call.bdrewery2014-04-101-1/+1
| | | | | Sponsored by: EMC / Isilon Storage Division MFC after: 1 week
* Fix wrong sizes used to access PD_Type and PD_State DDF metadata fields.mav2014-04-101-17/+39
| | | | | | | | 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. MFC after: 2 weeks
* Do not increment bio_data in case of BIO_DELETE.mav2014-04-101-3/+10
| | | | This fixes KASSERT() panic in g_io_request().
* An all-or-nothing approach to labels isn't flexible enough. Embeddedmarcel2014-04-061-2/+6
| | | | | | | | systems need fine-grained control over what's in and what's out. That's ideal. For now, separate GPT labels from the rest and allow g_label to be built with just GPT labels. Obtained from: Juniper Networks, Inc.
* Make sure we don't free memory that's already been freed by settingmarcel2014-04-061-1/+4
| | | | | | | the geom->softc pounter to NULL before freeing the g_slicer softc. In g_slicer_free() the pointer is checked first. Obtained from: Juniper Networks, Inc.
* Show error code when failing to destroy a mirror on delaybdrewery2014-04-051-1/+2
| | | | | Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks
* In g_eli_crypto_hmac_init(), zero out after using the ipad buffer,delphij2014-02-081-0/+1
| | | | | | | | | | | | | 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 MFC after: 2 weeks
* Fix the build with DEBUG enabled. Where possible, fix style(9) issues.loos2014-02-072-51/+58
| | | | | Reviewed by: bde Approved by: adrian (mentor)
* Fix a logic error. Because of this inflateReset() wasn't being called andloos2014-02-031-1/+1
| | | | | | | | | | the output buffer wasn't being cleared between the inflate() calls, producing zeroed output after the first inflate() call. This fixes the read of mkuzip(8) images with geom_uncompress(4). Reviewed by: ray Approved by: adrian (mentor)
* Remove some unnecessary code. The offsets read from the first block areloos2014-02-031-10/+4
| | | | | | | overwritten a few lines bellow. Reviewed by: ray Approved by: adrian (mentor)
* Always free sbuf in gctl_free().ae2014-01-231-1/+1
| | | | MFC after: 1 week
* Remove another unneeded NULL check from geom_alloc_copyin().ae2014-01-231-15/+15
| | | | | | | Do copyout in case of gctl version mismatch and fix sbuf leak in g_ctl_ioctl_ctl(). MFC after: 1 week
* In gctl_copyin() remove unused error variable.ae2014-01-231-8/+9
| | | | | | | | 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 after: 1 week
* Fix typo in r261084.ae2014-01-231-6/+7
| | | | | | | | | 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 after: 1 week
* malloc() with M_WAITOK doesn't return NULL.ae2014-01-231-4/+1
| | | | MFC after: 1 week
* Removed unneeded and dangerous assignment. It would probably cause NULLmav2014-01-191-1/+0
| | | | | | | refererence panic if compiler not optimize it out. Found with: Clang static analyzer MFC after: 2 weeks
* Build the geom_uncompress(4) module by default.loos2014-01-101-1/+1
| | | | | | | | | | | | | Fix geom_uncompress(4) module loading. Don't link zlib.c (which is a module itself) directly. The built module was verified and used to read a few mkulzma(8) images on amd64 to validate some of the informations on the manual page. While here, don't overwrite CFLAGS. Reviewed by: ray Approved by: adrian (mentor)
* Add an ability to stop gmirror and clear its metadata in one command.ae2013-12-273-4/+13
| | | | | | | | | | | | | | 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. MFC after: 2 weeks
OpenPOWER on IntegriCloud