aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/concat
Commit message (Collapse)AuthorAgeFilesLines
* GEOM: Set G_CF_DIRECT_SEND/RECEIVE for taste consumers.Alexander Motin2022-01-301-0/+1
| | | | | | | | | | All I/O requests through the taste consumers are synchronous, done with g_read_data() and without any locks held. It makes no sense to delegate the I/O to g_down/g_up threads. This removes many of context switches during disk retaste. MFC after: 2 weeks
* gconcat: Zero the metadata block before writingMark Johnston2021-07-131-12/+12
| | | | | | | | | | | | Ensure that string buffers and pad bytes are zero-filled before writing gconcat metadata. Also make sure to zero the full block buffer before encoding the metadata and writing. Fix some style bugs in g_concat_write_metadata() while here. Reported by: KMSAN MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* gconcat: Implement new online append featureNoah Bergbauer2021-06-142-0/+205
| | | | | | | | | | | | | Implement the "gconcat append" command which can be used to append a disk to the end of an existing gconcat device without unmounting. If the gconcat device is using the "automatic" method, i.e., stores metadata on the devices, new metadata is written to all existing components, as well as to the newly added one. Pull Request: https://github.com/freebsd/freebsd-src/pull/472 Reviewed by: imp@
* gconcat: Add new lock to allow modifications to the disk list in preparation ↵Noah Bergbauer2021-06-022-14/+52
| | | | | | | | | | for online append In addition, rename existing sc_lock to sc_append_lock Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/447 Sponsored by: Netflix
* gconcat: Switch array to TAILQ to prepare for online appendNoah Bergbauer2021-06-022-33/+40
| | | | | | Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/447 Sponsored by: Netflix
* Make g_attach() return ENXIO for orphaned providers; update variousEdward Tomasz Napierala2020-10-181-3/+5
| | | | | | | | | | | | | classes to add missing error checking. Reviewed by: imp MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26658 Notes: svn path=/head/; revision=366811
* geom: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365226
* Consistently use gctl_get_provider instead of home-grown variants.Xin LI2020-07-221-20/+8
| | | | | | | | | Reviewed by: cem, imp MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D25739 Notes: svn path=/head/; revision=363411
* g_concat_find_device: trim /dev/ if it is present, like other GEOMXin LI2020-07-091-0/+3
| | | | | | | | | | | classes. Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25596 Notes: svn path=/head/; revision=363036
* sys/geom: consistently use _PATH_DEV instead of hardcoding "/dev/".Xin LI2020-07-091-4/+4
| | | | | | | | | Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25565 Notes: svn path=/head/; revision=363034
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Pass BIO_SPEEDUP through all the geom layersWarner Losh2020-01-171-2/+6
| | | | | | | | | | | | | | | While some geom layers pass unknown commands down, not all do. For the ones that don't, pass BIO_SPEEDUP down to the providers that constittue the geom, as applicable. No changes to vinum or virstor because I was unsure how to add this support, and I'm also unsure how to test these. gvinum doesn't implement BIO_FLUSH either, so it may just be poorly maintained. gvirstor is for testing and not supportig BIO_SPEEDUP is fine. Reviewed by: chs Differential Revision: https://reviews.freebsd.org/D23183 Notes: svn path=/head/; revision=356818
* GEOM: Reduce unnecessary log interleaving with sbufsConrad Meyer2019-08-072-19/+5
| | | | | | | | | | | | | | | Similar to what was done for device_printfs in r347229. Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an sbuf; documented in g_bio.9. Reviewed by: markj Discussed with: rlibby Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21165 Notes: svn path=/head/; revision=350694
* Use sbuf_cat() in GEOM confxml generation.Alexander Motin2019-06-191-7/+7
| | | | | | | | | | | When it comes to megabytes of text, difference between sbuf_printf() and sbuf_cat() becomes substantial. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=349195
* Add a missing return statement to g_concat_kernel_dump().Mark Johnston2019-02-261-1/+3
| | | | | | | | | | The error occurs when upper layers attempt an out-of-bounds write. Submitted by: Noah Bergbauer <noah.bergbauer@tum.de> MFC after: 1 week Notes: svn path=/head/; revision=344600
* Use g_handleattr() to reply to GEOM::candelete queries.Mark Johnston2019-01-021-8/+4
| | | | | | | | | | | | | | | g_handleattr() fills out bp->bio_completed; otherwise, g_getattr() returns an error in response to the query. This caused BIO_DELETE support to not be propagated through stacked configurations, e.g., a gconcat of gmirror volumes would not handle BIO_DELETE even when the gmirrors do. g_io_getattr() was not affected by the problem. PR: 232676 Reported and tested by: noah.bergbauer@tum.de MFC after: 1 week Notes: svn path=/head/; revision=342687
* Have gconcat advertise delete support if one of its disks does.Mark Johnston2018-10-302-0/+36
| | | | | | | | | | | This follows the example set by other multi-disk GEOM classes. PR: 232676 Tested by: noah.bergbauer@tum.de MFC after: 1 month Notes: svn path=/head/; revision=339900
* Annotate geom modules with MODULE_VERSIONKyle Evans2018-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | GEOM ELI may double ask the password during boot. Once at loader time, and once at init time. This happens due a module loading bug. By default GEOM ELI caches the password in the kernel, but without the MODULE_VERSION annotation, the kernel loads over the kernel module, even if the GEOM ELI was compiled into the kernel. In this case, the newly loaded module purges/invalidates/overwrites the GEOM ELI's password cache, which causes the double asking. MFC Note: There's a pc98 component to the original submission that is omitted here due to pc98 removal in head. This part will need to be revived upon MFC. Reviewed by: imp Submitted by: op Obtained from: opBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14992 Notes: svn path=/head/; revision=332387
* sys/geom: adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-272-0/+4
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326270
* Use g_wither_provider() where applicable.Alexander Motin2016-09-231-2/+1
| | | | | | | | It is just a helper function combining G_PF_WITHER setting with g_orphan_provider(). Notes: svn path=/head/; revision=306279
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-2/+1
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-1/+2
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=267961
* Merge GEOM direct dispatch changes from the projects/camlock branch.Alexander Motin2013-10-222-25/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When safety requirements are met, it allows to avoid passing I/O requests to GEOM g_up/g_down thread, executing them directly in the caller context. That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid several context switches per I/O. The defined now safety requirements are: - caller should not hold any locks and should be reenterable; - callee should not depend on GEOM dual-threaded concurency semantics; - on the way down, if request is unmapped while callee doesn't support it, the context should be sleepable; - kernel thread stack usage should be below 50%. To keep compatibility with GEOM classes not meeting above requirements new provider and consumer flags added: - G_CF_DIRECT_SEND -- consumer code meets caller requirements (request); - G_CF_DIRECT_RECEIVE -- consumer code meets callee requirements (done); - G_PF_DIRECT_SEND -- provider code meets caller requirements (done); - G_PF_DIRECT_RECEIVE -- provider code meets callee requirements (request). Capable GEOM class can set them, allowing direct dispatch in cases where it is safe. If any of requirements are not met, request is queued to g_up or g_down thread same as before. Such GEOM classes were reviewed and updated to support direct dispatch: CONCAT, DEV, DISK, GATE, MD, MIRROR, MULTIPATH, NOP, PART, RAID, STRIPE, VFS, ZERO, ZFS::VDEV, ZFS::ZVOL, all classes based on g_slice KPI (LABEL, MAP, FLASHMAP, etc). To declare direct completion capability disk(9) KPI got new flag equivalent to G_PF_DIRECT_SEND -- DISKFLAG_DIRECT_COMPLETION. da(4) and ada(4) disk drivers got it set now thanks to earlier CAM locking work. This change more then twice increases peak block storage performance on systems with manu CPUs, together with earlier CAM locking changes reaching more then 1 million IOPS (512 byte raw reads from 16 SATA SSDs on 4 HBAs to 256 user-level threads). Sponsored by: iXsystems, Inc. MFC after: 2 months Notes: svn path=/head/; revision=256880
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-1/+2
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* Refactor disk disconnection and geom destruction handling sequences.Alexander Motin2011-11-012-50/+44
| | | | | | | | | | | Do not close/destroy opened consumer directly in case of disconnect. Instead keep it existing until it will be closed in regular way in response to upstream provider destruction. Delay geom destruction in the same way. Previous implementation could destroy consumers still having active requests and worked only because of global workaround made on GEOM level. Notes: svn path=/head/; revision=227004
* Include sys/sbuf.h directly.Andrey V. Elsukov2011-07-111-0/+1
| | | | | | | Reviewed by: pjd Notes: svn path=/head/; revision=223921
* Remove "for a moment" assignment. struct g_geom zeroed when allocated.Andrey V. Elsukov2011-05-041-2/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=221447
* Implement relaxed comparision for hardcoded provider names to make itAlexander Motin2011-04-271-1/+2
| | | | | | | | ignore adX/adaY difference in both directions to simplify migration to the CAM-based ATA or back. Notes: svn path=/head/; revision=221101
* Add some FEATURE macros for various GEOM classes.Alexander Leidinger2011-02-251-0/+1
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=219029
* Add support for dumping kernel to gconcat.Alexander Motin2010-09-161-0/+38
| | | | | | | Dumping goes to the component, where dump partition begins. Notes: svn path=/head/; revision=212754
* Make geom_concat to passthrough stripe parameters of the first component,Alexander Motin2009-12-241-5/+8
| | | | | | | hoping that rest will fit. Notes: svn path=/head/; revision=200942
* If provider is open for writing when we taste it, skip it for classes thatPawel Jakub Dawidek2009-10-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | depend on on-disk metadata. This was we won't attach to providers that are used by other classes. For example we don't want to configure partitions on da0 if it is part of gmirror, what we really want is partitions on mirror/foo. During regular work it works like this: if provider is open for writing a class receives the spoiled event from GEOM and detaches, once provider is closed the taste event is send again and class can rediscover its metadata if it is still there. This doesn't work that way when new class arrives, because GEOM gives all existing providers for it to taste, also those open for writing. Classes have to decided on their own if they want to deal with such providers (eg. geom_dev) or not (classes modified by this commit). Reported by: des, Oliver Lehmann <lehmann@ans-netz.de> Tested by: des, Oliver Lehmann <lehmann@ans-netz.de> Discussed with: phk, marcel Reviewed by: marcel MFC after: 3 days Notes: svn path=/head/; revision=197898
* Check return value of gctl_get_asciiparam().Edward Tomasz Napierala2009-05-121-0/+4
| | | | | | | | Found with: Coverity Prevent(tm) CID: 1118 Notes: svn path=/head/; revision=192021
* Add sbuf_new_auto as a shortcut for the very common case of creating aDag-Erling Smørgrav2008-08-091-1/+1
| | | | | | | | | | completely dynamic sbuf. Obtained from: Varnish MFC after: 2 weeks Notes: svn path=/head/; revision=181463
* Implement BIO_FLUSH handling by simply passing it down to the components.Pawel Jakub Dawidek2006-10-311-0/+39
| | | | | | | Sponsored by: home.pl Notes: svn path=/head/; revision=163836
* Remove trailing spaces.Pawel Jakub Dawidek2006-02-012-2/+2
| | | | Notes: svn path=/head/; revision=155174
* Allow to specify only one disk. This is helpful when we want to extendPawel Jakub Dawidek2006-01-301-3/+3
| | | | | | | | | our concatenated device later. MFC after: 1 week Notes: svn path=/head/; revision=155071
* Normalize a significant number of kernel malloc type names:Robert Watson2005-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names. Notes: svn path=/head/; revision=151897
* Before calling g_orphan_provider(), add G_PF_WITHER flag, so GEOM will knowPawel Jakub Dawidek2005-07-171-0/+1
| | | | | | | | | | | to destroy it. PR: kern/81758 Submitted by: trasz <trasz@buziaczek.pl> MFC after: 3 days Notes: svn path=/head/; revision=148092
* - Add a missing g_io_deliver() in case of allocation failure - we didn'tPawel Jakub Dawidek2005-04-031-3/+17
| | | | | | | | | | | | completed I/O requests here. - First allocate all needed bios, so if any of allocations fail, we can free memory before sending any I/O requests down. Reported by: Pawel Malachowski MFC after: 3 days Notes: svn path=/head/; revision=144592
* - Add md_provsize field to metadata, which will help withPawel Jakub Dawidek2005-02-272-4/+15
| | | | | | | | | | | | | | | | | | | | shared-last-sector problem. After this change, even if there is more than one provider with the same last sector, the proper one will be chosen based on its size. It still doesn't fix the 'c' partition problem (when da0s1 can be confused with da0s1c) and situation when 'a' partition starts at offset 0 (then da0s1a can be confused with da0s1 and da0s1c). One can use '-h' option there, when creating device or avoid sharing last sector. Actually, when providers share the same last sector and their size is equal, they provide exactly the same data, so the name (da0s1, da0s1a, da0s1c) isn't important at all. - Provide backward compatibility. - Update copyright's year. MFC after: 1 week Notes: svn path=/head/; revision=142727
* This is not needed anymore, it is forced in GEOM now.Pawel Jakub Dawidek2004-09-201-3/+0
| | | | | | | | | | | | Actually, it can even cause some problems, because GEOM requires sectorsize to be more than 0 on first access, not on provider creation, so we can skip valid providers by doing this check here. Reported by: Divacky Roman <xdivac02@stud.fit.vutbr.cz> Sven Willenberger <sven@dmv.com> Notes: svn path=/head/; revision=135522
* Allow to configure debug level from /boot/loader.conf.Pawel Jakub Dawidek2004-08-301-0/+1
| | | | Notes: svn path=/head/; revision=134528
* Skip providers with not defined sector size.Pawel Jakub Dawidek2004-08-261-0/+3
| | | | | | | Reported by: kuriyama Notes: svn path=/head/; revision=134344
* - Introduce option for hardcoding providers' names into metadata.Pawel Jakub Dawidek2004-08-092-1/+20
| | | | | | | | | | | | | | | It allows to fix problems when last provider's sector is shared between few providers. - Bump version number for CONCAT and STRIPE and add code for backward compatibility. - Do not bump version number of MIRROR, as it wasn't officially introduced yet. Even if someone started to play with it, there is no big deal, because wrong MD5 sum of metadata will deny those providers. - Update manual pages. - Add version history to g_(stripe|concat).h files. Notes: svn path=/head/; revision=133373
* Do not use g_wither_geom(9). I doesn't work in the way which is expectedPawel Jakub Dawidek2004-08-091-2/+3
| | | | | | | | here anymore (after g_wither_washer() was introduced), i.e. geom and consumer will not be immediately destroyed if possible. Notes: svn path=/head/; revision=133371
* Tag all geom classes in the tree with a version number.Poul-Henning Kamp2004-08-081-0/+1
| | | | Notes: svn path=/head/; revision=133318
* Improve geom(8)'s 'list' command to show geoms and their providers andPawel Jakub Dawidek2004-07-261-27/+36
| | | | | | | consumers. Teach STRIPE, CONCAT and NOP classes about this improvement. Notes: svn path=/head/; revision=132665
* Change naming scheme from /dev/<name>.concat to /dev/concat/<name>.Pawel Jakub Dawidek2004-07-262-16/+14
| | | | Notes: svn path=/head/; revision=132663