[systemd-devel] [PATCH 2/6] readahead-common:fs_on_ssd() stat might not get the real device name

Kay Sievers kay.sievers at vrfy.org
Fri Sep 24 03:38:44 PDT 2010


2010/9/24 Tomasz Torcz <tomek at pipebreaker.pl>:
> On Fri, Sep 24, 2010 at 12:22:34PM +0200, Kay Sievers wrote:
>> On Fri, Sep 24, 2010 at 12:06,  <harald at redhat.com> wrote:
>> > From: Harald Hoyer <harald at redhat.com>
>> >
>> > btrfs returns a major(0) for its device, so try to find the mountpoint and real device.
>>
>> > +        fp = fopen("/proc/self/mountinfo", "r");
>> > +        if (fp == NULL)
>> > +                return NULL;
>> > +        while (fscanf(fp, "%*s %*s %i:%i %*s %1024s %*s %*s %*s %1024s %*[^\n]", &maj, &min, mp, dev)
>>
>> Using device names from this file is not nice. I have just /dev/root
>> here. Shouldn't we just read the kernel commandline instead?
>
>  Kernel commandline could have root=UUID or LABEL there... and btrfs is
> strange beast, being a multi-device filesystem. I believe it could return
> any of underlaying device and run in raid0, 1, 10, soon raid 5/6 configuration.
>
>  "grubby" packages in fedora had similar problem with finding proper root
> device, see: https://bugzilla.redhat.com/show_bug.cgi?id=530108 for comments
> and patches.

Awesome! mtab parsing. Nobody sane has that file anymore. :)

Kay


More information about the systemd-devel mailing list