tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: spurious DIAGNOSTIC message "no disk label"



martin%duskware.de@localhost (Martin Husemann) writes:

># mount -o async,discard /dev/dk1 /mnt
>wd0: no disk label
>wd0: no disk label
>wd0: no disk label
>#

>It is not clear to me why we call dk_getlabel that often and whether this
>message would make any sense ever more than once (or in my use case ever at
>all).

That message existed before your use case was invented, so it has some
justification. Saying that, it's a "MD"-kind of message from the
private readdisklabel routine for sun and sparc platforms. Other
platforms like x86 return no error, if there is no disklabel (they do
if e.g. there is a corrupted disklabel or if the label sector cannot
be read).

Devices can be configured to keep a disklabel after the last close,
or to invalidate a disklabel after the last close. Almost all devices
use the latter as a default. This causes them to re-read the disklabel
for each first concurrent opener.

The mount command opens the device three times (and closes it twice).

1. looking up the device with getfsspecname.
   open is done by libutil
2. deducing the filesystem type without -t option
   open is done by the mount command
3. the mount system call.
   open is done by the kernel

For the first mounted wedge, that's three times the first concurrent
opener. Once a wedge is mounted, the parent device is open and further
mounts of wedges on the same parent device don't produce these
errors.

The error message is originally printed individually by every
driver. Some drivers now use the common dk_getdisklabel routine.
In any case, if there is no disklabel, then only the raw
partition can be accessed (which is used by the wedge driver).

Filtering the messages so its only printed once is difficult, as
three completely independent pieces of software trigger the message.

Filtering the message on type might be easier, but then the error
message ("no disklabel") needs to be replaced by an error code
for classification.

Filtering the message under specific conditions. E.g. suppress disklabel
warnings when the device has wedges. But that would also suppress
valid errors as wedges can also be used on disks that have a disklabel.

Filtering the message for specific operations might be easier. E.g.
suppress disklabel warnings when opening the raw partition.

You could also treat 'no disklabel' as no error for all platforms
and then rely on the default disklabel. Easiest if we get rid of
the MD disklabel routines first.

-- 
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index