summaryrefslogtreecommitdiffstats
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* Add legacy support to geom raid to create a /dev/arX device for supportsbruno2013-03-081-0/+22
| | | | | | | | | | | | | | | 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 Reviewed by: mav Obtained from: Yahoo! MFC after: 2 Weeks
* g_label_ntfs_taste: Abort taste is recsize == 0dumbbell2013-03-081-1/+1
| | | | | | | This will avoid a 0-byte read (in g_read_data()) leading to a panic, if previously read data are erroneous. Suggested by: John-Mark Gurney <jmg@funkthat.com>
* Support the FAT16 partition type in gpart(8)gavin2013-03-073-0/+3
| | | | | | PR: kern/174714 Submitted by: 4721 at hushmail dot com MFC after: 1 week
* Fix panic when Secondary_Element_Count == 1 and Secondary_Element_Seqmav2013-03-071-1/+4
| | | | | | | is not set (255). Reported by: sbruno MFC after: 1 week
* g_label_ntfs.c: Mark structures as __packeddumbbell2013-03-051-3/+3
| | | | | | Without this, read data is mis-interpreted. This could trigger a panic, as was the case on one computer where computed "recsize" was zero, leading to a call to g_read_page() asking for 0 bytes.
* Remove ntfs headers dependency for g_label_ntfs.c by redefining theattilio2013-03-021-14/+65
| | | | | | used structs and values. This patch is not targeted for MFC.
* Add barrier write capability to the VFS buffer interface. A barriermckusick2013-02-161-0/+4
| | | | | | | | | | | | | | | | | | | write is a disk write request that tells the disk that the buffer being written must be committed to the media along with any writes that preceeded it before any future blocks may be written to the drive. Barrier writes are provided by adding the functions bbarrierwrite (bwrite with barrier) and babarrierwrite (bawrite with barrier). Following a bbarrierwrite the client knows that the requested buffer is on the media. It does not ensure that buffers written before that buffer are on the media. It only ensure that buffers written before that buffer will get to the media before any buffers written after that buffer. A flush command must be sent to the disk to ensure that all earlier written buffers are on the media. Reviewed by: kib Tested by: Peter Holm
* g_mirror: g_getattr() failure should not be fatalavg2013-01-261-3/+1
| | | | | | | | | | | This allows to use gmirror e.g. on top of ZVOLs. PR: kern/175323 Submitted by: Alexei.Volkov@softlynx.ru, mav Reported by: Alexei.Volkov@softlynx.ru Tested by: Alexei.Volkov@softlynx.ru Reviewed by: ae, mav, pjd MFC after: 1 week
* - Fix rebuild position broken at r245522.mav2013-01-171-2/+5
| | | | - Identify one more metadata field.
* For Promise/AMD metadata add support for disks with capacity above 2TiBmav2013-01-171-55/+91
| | | | and for volumes with sector size above 512 bytes.
* Recalculate volume size only for real CONCATs. For SINGLE trust volumemav2013-01-171-1/+2
| | | | | size given by metadata, as it should be correct and in some cases can be smaller then subdisk size.
* Allow to insert new component to geom_raid3 without specifying number.mav2013-01-151-16/+29
| | | | | PR: kern/160562 MFC after: 2 weeks
* Alike to r242314 for GRAID make GRAID3 more aggressive in marking volumesmav2013-01-151-9/+12
| | | | | | | | | | | as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync 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
* Alike to r242314 for GRAID make GMIRROR more aggressive in marking volumesmav2013-01-151-9/+12
| | | | | | | | | | | | as clean on shutdown and move that action from shutdown_pre_sync stage to shutdown_post_sync 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. PR: kern/113957 MFC after: 2 weeks
* Keep value of orig_config_id metadata field. Windows driver writes theremav2013-01-141-2/+5
| | | | | previous value of config_id when it is changed in some cases. I guess it may be used do avoid some split-brain conditions.
* Small cosmetic tuning of the IRRT status constants.mav2013-01-141-4/+7
|
* Print some more metadata fields.mav2013-01-141-6/+12
|
* Windows driver writes relative volume IDs to metadata field. Use that valuemav2013-01-141-1/+2
| | | | as a hint for raid/rX device number to make it persistent across reboots.
* - Add checks for Intel metadata version and attributes. Ignore disks withmav2013-01-131-7/+41
| | | | | | unsupported metadata types like Intel Smart Response to not corrupt them. - Improve setting of these things during metadata writing to protect from incapable BIOS'es and other implementations.
* Improve support for disabled disks. If disabled disk disconnected and thenmav2013-01-132-21/+23
| | | | | reconnected back, leave it as disconnected. If new disk inserted instead of disabled, rebuild it and leave as enabled.
* Windows handles INIT and VERIFY as array-wide and it doesn't specify whichmav2013-01-121-2/+15
| | | | | | disks should be rebuilt. Our rebuild code is same time disk-centric. To handle this situation properly check all disks for RBLD flags, and if no disk specified try rebuild/resync all of them except newly inserted.
* Implement migration from single disk to RAID1/IRRT for Intel metadata.mav2013-01-121-6/+48
| | | | | | | Windows driver uses such migration when it creates new arrays. While GEOM RAID has no mechanism to implement migration in general case, this specifc case still can be handled easily via degraded RAID1 creation followed by regular rebuild.
* Add basic support for Intel Rapid Recover Technology (Intel RRT).mav2013-01-123-20/+102
| | | | | | | | | It is alike to RAID1, but with dedicating master and recovery disks and providing manual control over synchronization. It allows to use recovery disk as snapshot of the master disk from the time of the last sync. This implementation is not functionaly complete comparing to Windows, but it is better then silent conversion to RAID1 on first boot.
* Add flags argument to vfs_write_resume() and removekib2013-01-111-1/+1
| | | | | | vfs_write_resume_flags(). Sponsored by: The FreeBSD Foundation
* 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
OpenPOWER on IntegriCloud