summaryrefslogtreecommitdiffstats
path: root/sys/geom/label
Commit message (Collapse)AuthorAgeFilesLines
* MFC r284582:trasz2015-08-024-18/+19
| | | | | | | | Fix off-by-one error in fstyp(8) and geom_label(4) that made them use a single space (" ") as a CD9660 label name when no label was present. Similar problem was also present in msdosfs label recognition. Sponsored by: The FreeBSD Foundation
* MFC r256724:trasz2013-12-131-0/+12
| | | | | | | | | | | | Make geom_label(4) resize-aware. This fixes a situation when "gpart resize" would resize a partition, but label providers - e.g. /dev/gptid/XXX - would stay the same size. MFC r256766: Fix build with gcc by spelling unused format string as "unused" instead of NULL. Sponsored by: The FreeBSD Foundation
* - Use int8_t type for the mftrecsz field in g_label_ntfs. char typestas2013-05-051-3/+4
| | | | | | | | used previously caused probe failure on platforms where char is unsigned (e.g. ARM), as mftrecsz can be negative. Submitted by: Ilya Bakulin <ilya@bakulin.de> MFC after: 2 weeks
* Comment typo fix.ivoras2013-04-161-2/+2
| | | | Is aware of the importance of comments: dim
* Fix the buffer-overflow-fixing fixes.ivoras2013-04-161-15/+19
| | | | | | Pointy-hat to: me, for not realizing snprintf() is available in kernel. Thanks to: jh, for bringing me the good news of snprintf(), Pawel Worach, for noting that the panic can be provoked in i386 and not in amd64
* Introduce glabel labels based on GEOM ident attributes. In this initialivoras2013-04-153-1/+87
| | | | | | | | 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@
* 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>
* 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.
* 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
* 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
* 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.
* Revert r235918 for now and add comment explaining the reason for thetrasz2012-05-251-3/+9
| | | | size check.
* Make g_label(4) ignore provider size when looking for UFS labels.trasz2012-05-241-5/+3
| | | | | | | | Without it, it fails to create labels for filesystems resized by growfs(8). PR: kern/165962 Submitted by: Olivier Cochard-Labbe <olivier at cochard dot me>
* Include sys/sbuf.h directly.ae2011-07-111-0/+1
| | | | Reviewed by: pjd
* When checking existence of providers skip those which are orphaned.ae2011-05-041-0/+2
| | | | | PR: kern/132273 MFC after: 2 week
* Some linux distros put mount point into the ext2fs labels, such as '/', orsobomax2011-03-081-4/+10
| | | | | | | | | | | | '/boot', which confuses the devfs code and can cause userland programs to fail reading /dev/ext2fs directory with weird error code, such as any program that uses pwlib. Strip any leading slashes before feeding the label to the geom_label code. Sponsored by: Sippy Software, Inc. MFC after: 1 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-289-29/+68
| | | | | | | | | | 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
* Fix tabs, slightly improve comments.ivoras2009-06-181-9/+9
| | | | | Approved by: gnn (mentor) (original) Noticed by: stas
* Add support for labels derived from GPT metadata.ivoras2009-06-133-0/+168
| | | | | | | 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-253-12/+50
| | | | | | | | are always present and can be used to identify file systems (useful if hardware devices move often). Actually-by: pjd Approved by: gnn (mentor)
* - Use the correct argument when determining the buffer size.lulf2009-02-111-1/+1
| | | | | PR: kern/131575 MFC after: 2 days
* o s/resiserfs_sb/reiserfs_sb/.maxim2007-11-161-1/+1
| | | | Submitted by: Ighighi
* Remove trailing spaces.pjd2006-09-302-4/+4
|
* Fix detecting of UFS1 label when mediasize%fragsize != 0.pjd2006-09-161-2/+2
| | | | | | Submitted by: Stanislav Sedov PR: kern/84637 MFC after: 1 week
* Handle MSDOS file systems properly. Before the change file systemspjd2006-08-122-34/+295
| | | | | | | | created on Windows XP (and others maybe) were not detected. We detected only those created with newfs_msdos(8). Submitted by: Tobias Reifenberger <treif@mayn.de> style(9)ified by: pjd
* Verify if a label doesn't point to the parent directory.pjd2006-08-121-0/+24
|
* We need to check if file system size is equal to provider's size, becausepjd2006-03-041-2/+7
| | | | | | | | | | | | sysinstall(8) still bogusly puts first partition at offset 0 instead of 16, so glabel/ufs will find file system on slice instead of partition. Before sysinstall is fixed, we must keep this code, which means that we wont't be able to detect UFS file systems created with 'newfs -s ...'. PS. bsdlabel(8) creates partitions properly. MFC after: 3 days
* Inform when label disappears.pjd2006-02-181-16/+36
| | | | MFC after: 3 days
* - Do not depend on fact that file system covers entire provider.pjd2006-02-181-19/+13
| | | | | | | | It won't work for file systems created with -s option. Use better file system verfication. - Add myself to the copyright. MFC after: 3 days
* This function returns nothing.pjd2006-02-181-1/+1
|
* If provider's sector size prevents reading SBLOCKSIZE bytes returnpjd2006-02-181-8/+10
| | | | immediatelly.
* Remove trailing spaces.pjd2006-02-015-10/+10
|
* Style cleanups.pjd2006-01-181-24/+21
| | | | X-MFC-after: Already MFCed to RELENG_6 by accident.
* Don't pass error value pointer to g_read_data(9) at all if we don'tsobomax2005-11-303-6/+6
| | | | | | have any use of it. Suggested by: pjd
* Check for g_read_data(9) errors properly:sobomax2005-11-303-3/+3
| | | | | | | | | | o The only indication of error condition is NULL value returned by the function; o value pointed to by error argument is undefined in the case when operation completes successfully. Discussed with: phk
* We do nothing with returned error value, so just remove it.pjd2005-11-291-3/+2
|
* Check value returned by g_read_data(9), otherwise we can end in panic(9)sobomax2005-11-291-0/+3
| | | | | | if read error happens. MFC after: 1 week
* Add checking for File record magic.takawata2005-10-261-0/+6
|
* Verify length of the data to read as well.pjd2005-08-281-0/+2
|
* Verify offset before reading.pjd2005-08-261-1/+5
| | | | MFC after: 2 days
* Add NTFS labeling function.takawata2005-08-263-0/+115
| | | | Reviewed by:pjd
* Verify if we can actually read the data at given offset.pjd2005-08-232-6/+13
| | | | Reported by: Martin <nakal@nurfuerspam.de>
OpenPOWER on IntegriCloud