summaryrefslogtreecommitdiffstats
path: root/sys/geom/label/g_label.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix off-by-one error in fstyp(8) and geom_label(4) that made them usetrasz2015-06-181-0/+15
| | | | | | | | | | | a single space (" ") as a CD9660 label name when no label was present. Similar problem was also present in msdosfs label recognition. PR: 200828 Differential Revision: https://reviews.freebsd.org/D2830 Reviewed by: asomers@, emaste@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-281-2/+1
|
* Revert r267961, r267973:gjb2014-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
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-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
* 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.
* Fix build with gcc by spelling unused format string as "unused" instead of NULL.trasz2013-10-191-1/+1
| | | | MFC after: 29 days
* Make geom_label(4) resize-aware. This fixes a situation when "gpart resize"trasz2013-10-181-0/+12
| | | | | | | | | would resize a partition, but label providers - e.g. /dev/gptid/XXX - would stay the same size. Reviewed by: mav MFC after: 1 month Sponsored by: FreeBSD Foundation
* Introduce glabel labels based on GEOM ident attributes. In this initialivoras2013-04-151-1/+2
| | | | | | | | implementation, error on the side of conservatism and only create labels for GEOMs of classes DISK and MULTIPATH. Discussed with: trasz Approved by: silence from freebsd-geom@
* 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-201-1/+1
| | | | | | | - Add __printflike() attributes. - Remove an extra argument for the g_new_geomf() call in swapongeom_ev(). Reviewed by: pjd
* It seems that it is preferable to keep support for glabel also forattilio2012-10-181-0/+1
| | | | | | | | | 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-171-1/+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.
* When checking existence of providers skip those which are orphaned.ae2011-05-041-0/+2
| | | | | PR: kern/132273 MFC after: 2 week
* Add some FEATURE macros for various GEOM classes.netchild2011-02-251-0/+2
| | | | | | | | | | | 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
* - Report an error when a label with invalid name is attempted to bejh2010-12-011-4/+6
| | | | | | | | created with glabel(8). - Fix a typo in an error message. - Fix comment typos. Approved by: pjd
* g_label: fix possible NULL pointer dereferenceavg2010-05-311-4/+2
| | | | | | | | in case glabel debug level is >= 1 and gp->provider list is empty for some reason Found by: clang static analyzer MFC after: 4 days
* Provide a set of sysctls and tunables to disable device node creationtrasz2009-11-281-1/+2
| | | | | | | | | | for specific "kinds" of disk labels - for example, GPT UUIDs. Reason for this is that sometimes, other GEOM classes attach to these device nodes instead of the proper ones - e.g. they attach to /dev/gptid/XXX instead of /dev/ada0p2, which is annoying. Reviewed by: pjd (earlier version) MFC after: 1 month
* If provider is open for writing when we taste it, skip it for classes thatpjd2009-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
* Add support for labels derived from GPT metadata.ivoras2009-06-131-0/+2
| | | | | | | Approved by: gnn (mentor) Reviewed by: pjd PR: 128398 Submitted by: Marius Nuennerich < marius at nuenneri.ch >
* Crank the debug level necessary to display the "Label foo is removed"dougb2009-05-301-4/+4
| | | | and "Label for provider ..." messages up from 0 to 1.
* Create GEOM labels from UFS IDs, e.g. /dev/ufsid/49c97b1faa2adc43. UFS IDsivoras2009-03-251-1/+2
| | | | | | | | are always present and can be used to identify file systems (useful if hardware devices move often). Actually-by: pjd Approved by: gnn (mentor)
* Verify if a label doesn't point to the parent directory.pjd2006-08-121-0/+24
|
* Inform when label disappears.pjd2006-02-181-16/+36
| | | | MFC after: 3 days
* Remove trailing spaces.pjd2006-02-011-6/+6
|
* Add NTFS labeling function.takawata2005-08-261-0/+1
| | | | Reviewed by:pjd
* Back-out the change from revision 1.14 and allow for '/' in labels again.pjd2005-08-201-8/+0
| | | | | Convinced by: green, Gavin Atkinson, dougb, gordon MFC after: 1 day
* Provide more complete "How to add a new file system to glabel." list.pjd2005-08-121-3/+7
| | | | MFC after: 1 week
* Add code for Ext2FS and ReiserFS labels recognition.pjd2005-08-121-0/+2
| | | | | | Submitted by: Stanislav Sedov <stas@310.ru> PR: kern/84638 MFC after: 1 week
* Avoid creating directories in devfs by changing all '/' in labels to '_'.pjd2005-08-121-0/+8
| | | | | Idea from: Stanislav Sedov <stas@310.ru> MFC after: 3 days
* - Add md_provsize field to metadata, which will help withpjd2005-02-271-1/+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
* Only allow for unloading when there are no geoms in LABEL GEOM class.pjd2004-10-141-1/+16
| | | | | | | | | We have to use our own destroy_geom method, because default one, which is a part of geom_slice is broken. MT5 candidate. PR: kern/72467 Submitted by: Vladimir Novoseltsev
* This is not needed anymore, it is forced in GEOM now.pjd2004-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>
* Allow to configure debug level from /boot/loader.conf.pjd2004-08-301-0/+1
|
* Skip providers with not defined sector size.pjd2004-08-261-0/+3
| | | | Reported by: kuriyama
* Do not use g_wither_geom(9). I doesn't work in the way which is expectedpjd2004-08-091-12/+8
| | | | | here anymore (after g_wither_washer() was introduced), i.e. geom and consumer will not be immediately destroyed if possible.
* Tag all geom classes in the tree with a version number.phk2004-08-081-0/+1
|
* Decrease log level of one debug message, so there is no hole (level 2pjd2004-07-131-1/+1
| | | | wasn't used at all).
* Add missing argument.pjd2004-07-061-1/+1
|
* Properly free resources if g_access() fails.pjd2004-07-061-1/+3
|
* - Add 'stop' command, which works just like 'destroy' command, but soundspjd2004-07-051-1/+2
| | | | | | less dangerous. - Update manual pages and extend examples. - Bump versions.
* Introduce GEOM_LABEL class.pjd2004-07-021-0/+405
This class is used for detecting volume labels on file systems: UFS, MSDOSFS (FAT12, FAT16, FAT32) and ISO9660. It also provide native labelization (there is no need for file system). g_label_ufs.c is based on geom_vol_ffs from Gordon Tetlow. g_label_msdos.c and g_label_iso9660.c are probably hacks, I just found where volume labels are stored and I use those offsets here, but with this class it should be easy to do it as it should be done by someone who know how. Implementing volume labels detection for other file systems also should be trivial. New providers are created in those directories: /dev/ufs/ (UFS1, UFS2) /dev/msdosfs/ (FAT12, FAT16, FAT32) /dev/iso9660/ (ISO9660) /dev/label/ (native labels, configured with glabel(8)) Manual page cleanups and some comments inside were submitted by Simon L. Nielsen, who was, as always, very helpful. Thanks!
OpenPOWER on IntegriCloud