History log of /freebsd-10.0-release/sys/geom/label/g_label.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 249508 15-Apr-2013 ivoras

Introduce glabel labels based on GEOM ident attributes. In this initial
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@


# 244585 22-Dec-2012 jh

Mangle label names containing spaces, non-printable characters '%' or
'"'. 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


# 243333 20-Nov-2012 jh

- Don't pass geom and provider names as format strings.
- Add __printflike() attributes.
- Remove an extra argument for the g_new_geomf() call in swapongeom_ev().

Reviewed by: pjd


# 241706 18-Oct-2012 attilio

It seems that it is preferable to keep support for glabel also for
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


# 241636 17-Oct-2012 attilio

Disconnect non-MPSAFE NTFS from the build in preparation for dropping
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.


# 221433 04-May-2011 ae

When checking existence of providers skip those which are orphaned.

PR: kern/132273
MFC after: 2 week


# 219029 25-Feb-2011 netchild

Add some FEATURE macros for various GEOM classes.

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


# 216098 01-Dec-2010 jh

- Report an error when a label with invalid name is attempted to be
created with glabel(8).
- Fix a typo in an error message.
- Fix comment typos.

Approved by: pjd


# 208672 31-May-2010 avg

g_label: fix possible NULL pointer dereference

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


# 199875 28-Nov-2009 trasz

Provide a set of sysctls and tunables to disable device node creation
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


# 197898 09-Oct-2009 pjd

If provider is open for writing when we taste it, skip it for classes that
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


# 194092 12-Jun-2009 ivoras

Add support for labels derived from GPT metadata.

Approved by: gnn (mentor)
Reviewed by: pjd
PR: 128398
Submitted by: Marius Nuennerich < marius at nuenneri.ch >


# 193131 30-May-2009 dougb

Crank the debug level necessary to display the "Label foo is removed"
and "Label for provider ..." messages up from 0 to 1.


# 190423 25-Mar-2009 ivoras

Create GEOM labels from UFS IDs, e.g. /dev/ufsid/49c97b1faa2adc43. UFS IDs
are always present and can be used to identify file systems (useful if
hardware devices move often).

Actually-by: pjd
Approved by: gnn (mentor)


# 161245 12-Aug-2006 pjd

Verify if a label doesn't point to the parent directory.


# 155803 18-Feb-2006 pjd

Inform when label disappears.

MFC after: 3 days


# 155174 01-Feb-2006 pjd

Remove trailing spaces.


# 149492 26-Aug-2005 takawata

Add NTFS labeling function.

Reviewed by:pjd


# 149339 20-Aug-2005 pjd

Back-out the change from revision 1.14 and allow for '/' in labels again.

Convinced by: green, Gavin Atkinson, dougb, gordon
MFC after: 1 day


# 148979 11-Aug-2005 pjd

Provide more complete "How to add a new file system to glabel." list.

MFC after: 1 week


# 148978 11-Aug-2005 pjd

Add code for Ext2FS and ReiserFS labels recognition.

Submitted by: Stanislav Sedov <stas@310.ru>
PR: kern/84638
MFC after: 1 week


# 148977 11-Aug-2005 pjd

Avoid creating directories in devfs by changing all '/' in labels to '_'.

Idea from: Stanislav Sedov <stas@310.ru>
MFC after: 3 days


# 142727 27-Feb-2005 pjd

- Add md_provsize field to metadata, which will help with
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


# 136503 14-Oct-2004 pjd

Only allow for unloading when there are no geoms in LABEL GEOM class.
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


# 135524 20-Sep-2004 pjd

Force commit to provider more detailed info about this change.

There is no need to skip providers with 0 sectorsize in taste routine,
it is now forced by GEOM.
Actually, it can even cause some problems, because GEOM requires sectorsize
to be greater than 0 on first access, not on provider creation, so we can
skip valid providers by doing this check in taste method.

Requested by: scottl


# 135522 20-Sep-2004 pjd

This is not needed anymore, it is forced in GEOM now.
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>


# 134528 30-Aug-2004 pjd

Allow to configure debug level from /boot/loader.conf.


# 134344 26-Aug-2004 pjd

Skip providers with not defined sector size.

Reported by: kuriyama


# 133371 09-Aug-2004 pjd

Do not use g_wither_geom(9). I doesn't work in the way which is expected
here anymore (after g_wither_washer() was introduced), i.e. geom and consumer
will not be immediately destroyed if possible.


# 133318 08-Aug-2004 phk

Tag all geom classes in the tree with a version number.


# 132097 13-Jul-2004 pjd

Decrease log level of one debug message, so there is no hole (level 2
wasn't used at all).


# 131718 06-Jul-2004 pjd

Add missing argument.


# 131716 06-Jul-2004 pjd

Properly free resources if g_access() fails.


# 131649 05-Jul-2004 pjd

- Add 'stop' command, which works just like 'destroy' command, but sounds
less dangerous.
- Update manual pages and extend examples.
- Bump versions.


# 131476 02-Jul-2004 pjd

Introduce GEOM_LABEL class.
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!