summaryrefslogtreecommitdiffstats
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* Reset provider-specific fields when resending I/O request in low memorypjd2012-12-261-0/+3
| | | | | | | | conditions. This fixes assertion which checks those fields when kernel is compiled with DIAGNOSTIC. Reported by: kib, pho MFC after: 1 week
* Mangle label names containing spaces, non-printable characters '%' orjh2012-12-221-0/+23
| | | | | | | | | '"'. Mangling is only done for label names read from file system metadata. Encoding resembles URL encoding. For example, the space character becomes %20. Help by: kib Discussed with: imp, kib, pjd
* - Don't pass geom and provider names as format strings.jh2012-11-2013-18/+20
| | | | | | | - Add __printflike() attributes. - Remove an extra argument for the g_new_geomf() call in swapongeom_ev(). Reviewed by: pjd
* Provide a device name in the sysctl tree for programs to query thealfred2012-11-011-3/+3
| | | | | | | | | state of crashdump target devices. This will be used to add a "-l" (ell) flag to dumpon(8) to list the currently configured dumpdev. Reviewed by: phk
* Fix problem with geom_label(4) not recognizing UFS labels on filesystemstrasz2012-10-301-1/+2
| | | | | | | | | | | | | | | | | | extended using growfs(8). The problem here is that geom_label checks if the filesystem size recorded in UFS superblock is equal to the provider (i.e. device) size. This check cannot be removed due to backward compatibility. On the other hand, in most cases growfs(8) cannot set fs_size in the superblock to match the provider size, because, differently from newfs(8), it cannot recompute cylinder group sizes. To fix this problem, add another superblock field, fs_providersize, used only for this purpose. The geom_label(4) will attach if either fs_size (filesystem created with newfs(8)) or fs_providersize (filesystem expanded using growfs(8)) matches the device size. PR: kern/165962 Reviewed by: mckusick Sponsored by: FreeBSD Foundation
* Minor addition to r242323:mav2012-10-292-4/+4
| | | | | | | | Alike to BIO_WRITE, report success if at least one subdisk succeeded with BIO_DELETE. But unlike BIO_WRITE don't fail disk on BIO_DELETE error. Sponsored by: iXsystems, Inc. MFC after: 1 month
* Add basic BIO_DELETE support to GEOM RAID class for all RAID levels.mav2012-10-2912-173/+91
| | | | | | | | | If at least one subdisk in the volume supports it, BIO_DELETE requests will be propagated down. Unfortunatelly, for RAID levels with redundancy unmapped blocks will be mapped back during first rebuild/resync process. Sponsored by: iXsystems, Inc. MFC after: 1 month
* Fix locking problem in disk_resize(); previously it would run withouttrasz2012-10-292-22/+16
| | | | | | topology lock, resulting in assertion when running with DIAGNOSTIC. Reviewed by: mav (earlier version)
* Make GEOM RAID more aggressive in marking volumes as clean on shutdownmav2012-10-291-17/+20
| | | | | | | | | | | and move that action from shutdown_pre_sync to shutdown_post_sync stage to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. MFC after: 2 weeks
* Remove the support for using non-mpsafe filesystem modules.kib2012-10-222-18/+4
| | | | | | | | | | | | In particular, do not lock Giant conditionally when calling into the filesystem module, remove the VFS_LOCK_GIANT() and related macros. Stop handling buffers belonging to non-mpsafe filesystems. The VFS_VERSION is bumped to indicate the interface change which does not result in the interface signatures changes. Conducted and reviewed by: attilio Tested by: pho
* It seems that it is preferable to keep support for glabel also forattilio2012-10-182-0/+2
| | | | | | | | | filesystems that we don't support natively. Revert part of r241636 to do so. This patch is not targeted for MFC. Requested by: gleb, jhb
* Disconnect non-MPSAFE NTFS from the build in preparation for droppingattilio2012-10-172-2/+0
| | | | | | | | | | | | | | GIANT from VFS. This code is particulary broken and fragile and other in-kernel implementations around, found in other operating systems, don't really seem clean and solid enough to be imported at all. If someone wants to reconsider in-kernel NTFS implementation for inclusion again, a fair effort for completely fixing and cleaning it up is expected. In the while NTFS regular users can use FUSE interface and ntfs-3g port to work with their NTFS partitions. This is not targeted for MFC.
* NULL-ify last previously used pointer instead of last possible pointer.mav2012-10-101-3/+3
| | | | | | This should be only a cosmetic change. Found by: Clang Static Analyzer
* Make graid command line a bit more friendly by allowing volume name ormav2012-10-074-12/+83
| | | | | | | | | | provider name to be specified instead of geom name (first argument in all subcommands except label). In most cases there is only one array used any way, so it is not really useful to make user type ugly geom names like Intel-f0bdf223 or SiI-732c2b9448cf. Though they can be used in some cases. Sponsored by: iXsystems, Inc. MFC after: 1 month
* g_part_taste: directly destroy consumer and geom here, no need for witheringavg2012-10-061-2/+7
| | | | | | | Besides withered but still alive consumers may interfere with re-tatsing. MFC after: 16 days
* Remove the topology lock from disk_gone(), it might be called with regularpjd2012-09-281-3/+5
| | | | | | | | | | | | | | mutexes held and the topology lock is an sx lock. The topology lock was there to protect traversing through the list of providers of disk's geom, but it seems that disk's geom has always exactly one provider. Change the code to call g_wither_provider() for this one provider, which is safe to do without holding the topology lock and assert that there is indeed only one provider. Discussed with: ken MFC after: 1 week
* Use the topology lock to protect list of providers while withering them.pjd2012-09-221-1/+4
| | | | | | | | | It is possible that provider is destroyed while we are iterating over the list. Reported by: Brian Parkison <parkison@panzura.com> Discussed with: phk MFC after: 1 week
* g_disk_flushcache definitely should not be traced under G_T_TOPOLOGYavg2012-09-181-1/+1
| | | | | | ... use G_T_BIO instead MFC after: 1 week
* Add global and per-module sysctls/tunables to enable/disable metadata taste.mav2012-09-1313-31/+70
| | | | | | | That should help to handle some cases when disk has some RAID metadata that should be ignored, especially during boot. MFC after: 3 days
* When synchronizing, include in the config dump amount ofglebius2012-09-112-0/+10
| | | | | | | | | | | | | | | bytes syncronized. The rationale behind this is the following: for large disks the percent synchronisation counter ticks too seldom, and monitoring software (as well as human operator) can't tell whether synchronisation goes on or one of disks got stuck. On an idle server one can look into gstat and see whether synchronisation goes on or not, but on a busy server that won't work. Also, new value monitored can be differentiated obtaining the synchronisation speed quite precisely. Submitted by: Konstantin Kukushkin <dark ramtel.ru> Reviewed by: pjd
* Allow to pass providers with /dev/ prefix to g_provider_by_name().pjd2012-09-011-0/+8
| | | | MFC after: 3 days
* Remove unneeded G_PF_CANDELETE flag.ed2012-08-289-24/+0
| | | | | This flag is only used by GEOM so it can be propagated to the character device's SI_CANDELETE. Unfortunately, SI_CANDELETE seems to do nothing.
* (g_multipath_rotate): Fix algorithm so that it does rotate over all goodthomas2012-08-251-3/+10
| | | | | | | | providers, not just the last two. PR: kern/170379 Reviewed by: mav MFC after: 2 weeks
* Always initialize sc_ekey, because as of r238116 it is always used.pjd2012-08-101-12/+13
| | | | | | | | | | | | | | | | | | | If GELI provider was created on FreeBSD HEAD r238116 or later (but before this change), it is using very weak keys and the data is not protected. The bug was introduced on 4th July 2012. One can verify if its provider was created with weak keys by running: # geli dump <provider> | grep version If the version is 7 and the system didn't include this fix when provider was initialized, then the data has to be backed up, underlying provider overwritten with random data, system upgraded and provider recreated. Reported by: Fabian Keil <fk@fabiankeil.de> Tested by: Fabian Keil <fk@fabiankeil.de> Discussed with: so MFC after: 3 days
* Add missing FAILED event to g_raid_subdisk_event2str() to print it properlymav2012-08-101-0/+2
| | | | | | in debug messages. Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
* Clone BIO_ORDERED flag, for disk drivers (namely CAM) that try tojimharris2012-08-071-0/+6
| | | | | | | consume it. Sponsored by: Intel Discussed with: gibbs, scottl
* In g_gate_dumpconf() always check the result of g_gate_hold().trociny2012-08-071-1/+3
| | | | | | | | This fixes "Negative sc_ref" panic possible when sysctl_kern_geom_confxml() is run simultaneously with destroying GATE device. Reviewed by: pjd MFC after: 3 days
* In virstor_ctl_stop(), check for a valid softc before trying to updatejimharris2012-08-031-0/+6
| | | | | | | | | metadata. Sponsored by: Intel Reported and tested by: Marcelo Gondim <gondim at bsdinfo dot com dot br> PR: kern/170199 MFC after: 3 days
* New command "gmultipath prefer" to force selection of a specifiedthomas2012-08-031-0/+74
| | | | | | | provider in an Active/Passive configuration. Reviewed by: mav MFC after: 4 weeks
* Partially revert r238886 in part of GEOM_VFS spoiling.mav2012-07-291-30/+1
| | | | | | This change triggered interesting foot shooting condition in GEOM when RW access to root partition by fsck spoils VFS geom there, which has it opened RO at the same time. Seems spoiling concept needs some rework.
* Implement media change notification for DA and CD removable media devices.mav2012-07-2910-29/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It includes three parts: 1) Modifications to CAM to detect media media changes and report them to disk(9) layer. For modern SATA (and potentially UAS) devices it utilizes Asynchronous Notification mechanism to receive events from hardware. Active polling with TEST UNIT READY commands with 3 seconds period is used for incapable hardware. After that both CD and DA drivers work the same way, detecting two conditions: "NOT READY: Medium not present" after medium was detected previously, and "UNIT ATTENTION: Not ready to ready change, medium may have changed". First one reported to disk(9) as media removal, second as media insert/change. To reliably receive second event new AC_UNIT_ATTENTION async added to make UAs broadcasted to all periphs by generic error handling code in cam_periph_error(). 2) Modifications to GEOM core to handle media remove and change events. Media removal handled by spoiling all consumers attached to the provider. Media change event also schedules provider retaste after spoiling to probe new media. New flag G_CF_ORPHAN was added to consumers to reflect that consumer is in process of destruction. It allows retaste to create new geom instance of the same class, while previous one is still dying. 3) Modifications to some GEOM classes: DEV -- to report media change events to devd; VFS -- to handle spoiling same as orphan to prevent accessing replaced media. PART class already handles spoiling alike to orphan. Reviewed by: silence on geom@ and scsi@ Tested by: avg Sponsored by: iXsystems, Inc. / PC-BSD MFC after: 2 months
* Reorder things in g_gate_create() so at the moment when g_new_geomf()trociny2012-07-281-77/+63
| | | | | | | is called name is properly initialized. Discussed with: pjd MFC after: 2 weeks
* Make it possible to resize opened partitions.trasz2012-07-201-3/+8
| | | | Sponsored by: FreeBSD Foundation
* Add missing free.trasz2012-07-181-0/+1
|
* Add back spare fields consumed in r237545. It seems that these should onlyken2012-07-171-0/+2
| | | | | | | be consumed to maintain backward compatibility in stable, but should not be consumed in head. Submitted by: trasz, attilio (indirectly)
* The resize GEOM event has no references, thus cannot be canceled.trasz2012-07-161-2/+0
|
* Add back spare fields reused in r238213. According to Attilio, the ruletrasz2012-07-161-0/+2
| | | | is to use reuse spares only when MFC-ing, not in CURRENT.
* Add trivial resize handling to gnop(8).trasz2012-07-072-0/+29
| | | | | Reviewed by: mav Sponsored by: FreeBSD Foundation
* Add trivial resize handling to gmountver(8).trasz2012-07-071-0/+14
| | | | | Reviewed by: mav Sponsored by: FreeBSD Foundation
* Add disk_resize(), to make it possible for the disk drivers such as da(4)trasz2012-07-072-0/+43
| | | | | | | to notify GEOM about LUN size change. Reviewed by: mav (earlier version) Sponsored by: FreeBSD Foundation
* Add a new GEOM method, resize(), which is called after provider size changes.trasz2012-07-072-5/+80
| | | | | | | | Add a new routine, g_resize_provider(), to use to notify GEOM about provider change. Reviewed by: mav Sponsored by: FreeBSD Foundation
* Fix orphan() methods of several GEOM classes to not assume that theretrasz2012-07-075-17/+5
| | | | | | | | | is an error set on the provider. With GEOM resizing, class can become orphaned when it doesn't implement resize() method and the provider size decreases. Reviewed by: mav Sponsored by: FreeBSD Foundation
* Fix typo in the comment.trasz2012-07-061-1/+1
|
* Extend GEOM Gate class to handle read I/O requests directly within the kernel.pjd2012-07-042-35/+314
| | | | | | | | This will allow HAST to read directly from the local component without even communicating userland daemon. Sponsored by: Panzura, http://www.panzura.com MFC after: 1 month
* Use correct part of the Master-Key for generating encryption keys.pjd2012-07-044-6/+27
| | | | | | | | | | | | Before this change the IV-Key was used to generate encryption keys, which was incorrect, but safe - for the XTS mode this key was unused anyway and for CBC mode it was used differently to generate IV vectors, so there is no risk that IV vector collides with encryption key somehow. Bump version number and keep compatibility for older versions. MFC after: 2 weeks
* Correct comment.pjd2012-07-041-1/+1
| | | | MFC after: 3 days
* Correct a comment and correct style of a flag check.pjd2012-07-041-2/+2
| | | | MFC after: 3 days
* Make geom_mirror more friendly to SSDs. To properly support TRIM,glebius2012-07-012-3/+15
| | | | | | | | | | | | | | | | | | | | | we need to pass BIO_DELETE requests down to providers that support it. Also, we need to announce our support for BIO_DELETE to upper consumer. This requires: - In g_mirror_start() return true for "GEOM::candelete" request. - In g_mirror_init_disk() probe below provider for "GEOM::candelete" attribute, and mark disk with a flag if it does support BIO_DELETE. - In g_mirror_register_request() distribute BIO_DELETE requests only to those disks, that do support it. Note that we announce "GEOM::candelete" as true unconditionally of whether we have TRIM-capable media down below or not. This is made intentionally, because upper consumer (usually UFS) requests the attribite only once at mount time. And if user ever migrates his mirror from HDDs to SSDs, then he/she would get TRIM working without remounting filesystem. Reviewed by: pjd
* In g_mirror_regular_request() upon successful delivery treatglebius2012-07-011-1/+2
| | | | | | | BIO_DELETE requests same way as BIO_WRITE removing them from queue. This fixes panic with BIO_DELETE operations on geom_mirror. Reviewed by: pjd
* Use %j to match intmax_t.imp2012-07-011-1/+1
|
OpenPOWER on IntegriCloud