[systemd-devel] [PATCH 2/6] readahead-common:fs_on_ssd() stat might not get the real device name
Tomasz Torcz
tomek at pipebreaker.pl
Fri Sep 24 03:31:46 PDT 2010
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.
--
Tomasz Torcz "Never underestimate the bandwidth of a station
xmpp: zdzichubg at chrome.pl wagon filled with backup tapes." -- Jim Gray
More information about the systemd-devel
mailing list