History log of /freebsd-9.3-release/sys/geom/label/
Revision Date Author Comments
267654 20-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

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


246284 03-Feb-2013 trasz

MFC r242379:

Fix problem with geom_label(4) not recognizing UFS labels on filesystems
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


244547 21-Dec-2012 jh

MFC r243333:

- 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().


225736 23-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


223921 11-Jul-2011 ae

Include sys/sbuf.h directly.

Reviewed by: pjd


221433 04-May-2011 ae

When checking existence of providers skip those which are orphaned.

PR: kern/132273
MFC after: 2 week


219400 08-Mar-2011 sobomax

Some linux distros put mount point into the ext2fs labels, such as '/', or
'/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


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


194433 18-Jun-2009 ivoras

Fix tabs, slightly improve comments.

Approved by: gnn (mentor) (original)
Noticed by: stas


194092 13-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)


188492 11-Feb-2009 lulf

- Use the correct argument when determining the buffer size.

PR: kern/131575
MFC after: 2 days


173677 16-Nov-2007 maxim

o s/resiserfs_sb/reiserfs_sb/.

Submitted by: Ighighi


162834 30-Sep-2006 pjd

Remove trailing spaces.


162357 16-Sep-2006 pjd

Fix detecting of UFS1 label when mediasize%fragsize != 0.

Submitted by: Stanislav Sedov
PR: kern/84637
MFC after: 1 week


161246 12-Aug-2006 pjd

Handle MSDOS file systems properly. Before the change file systems
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


161245 12-Aug-2006 pjd

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


156299 04-Mar-2006 pjd

We need to check if file system size is equal to provider's size, because
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


155803 18-Feb-2006 pjd

Inform when label disappears.

MFC after: 3 days


155801 18-Feb-2006 pjd

- Do not depend on fact that file system covers entire provider.
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


155798 18-Feb-2006 pjd

This function returns nothing.


155797 18-Feb-2006 pjd

If provider's sector size prevents reading SBLOCKSIZE bytes return
immediatelly.


155174 01-Feb-2006 pjd

Remove trailing spaces.


154513 18-Jan-2006 pjd

Style cleanups.

X-MFC-after: Already MFCed to RELENG_6 by accident.


152971 30-Nov-2005 sobomax

Don't pass error value pointer to g_read_data(9) at all if we don't
have any use of it.

Suggested by: pjd


152967 30-Nov-2005 sobomax

Check for g_read_data(9) errors properly:

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


152922 29-Nov-2005 pjd

We do nothing with returned error value, so just remove it.


152913 29-Nov-2005 sobomax

Check value returned by g_read_data(9), otherwise we can end in panic(9)
if read error happens.

MFC after: 1 week


151684 26-Oct-2005 takawata

Add checking for File record magic.


149538 28-Aug-2005 pjd

Verify length of the data to read as well.


149495 26-Aug-2005 pjd

Verify offset before reading.

MFC after: 2 days


149492 26-Aug-2005 takawata

Add NTFS labeling function.

Reviewed by:pjd


149395 23-Aug-2005 pjd

Verify if we can actually read the data at given offset.

Reported by: Martin <nakal@nurfuerspam.de>


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 12-Aug-2005 pjd

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

MFC after: 1 week


148978 12-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 12-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


145306 19-Apr-2005 wollman

The size of a filesystem may be less than the size of the provider it
resides on. Fix the special case of the filesystem fragment size not
evenly dividing the size of the provider. Fixing the general case
probably requires better superblock validation (left as an exercise to
the reader).


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


141513 08-Feb-2005 des

merge from geom_vol_ffs.c rev 1.14 (avoid unaligned I/O requests)


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


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.


132098 13-Jul-2004 pjd

Remove unused macro.


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!