[PATCH] mdev doesn't correctly determine whether device is block/char (2.6.25 kernel)
Denys Vlasenko
vda.linux at googlemail.com
Wed May 14 08:32:55 PDT 2008
On Wednesday 14 May 2008 08:39, virdiq virdiq wrote:
> I'm having problems with busybox-1.10.2 and the 2.6.25 kernel (with the
> deprecated sysfs structure turned off) where mdev always creates character
> device nodes (when some of them should be block device nodes). I've tried
> the trunk version of busybox as well as busybox 1.10.1 and busybox 1.10.2
> with all current patches... all with no solution to the problem.
>
> There is a bug filed on the Gentoo bugzilla at
> https://bugs.gentoo.org/show_bug.cgi?id=212031 which I've been following but
> it offers no solution that works for me.
>
> I've attached the patch which WorkedForMe[TM] (this patch was already a TODO
> in the code).
>
> Would it be possible to act on this TODO and fix the block/character device
> recognition so it uses strstr instead of the current unstable/unpredictable
> strcmp method?
bug page says:
> This expects the /sys/block/FOO to be a directory. However, in 2.6.25,
> /dev/block/FOO is a symlink to another location.
So what? How this can possibly affect path matching code?
path variable here:
if (strncmp(&path[5], "class/block/"+6, 6) != 0
&& strncmp(&path[5], "class/block/", 12) != 0)
type = S_IFCHR;
else
type = S_IFBLK;
comes directly from DEVPATH env var, no symlink resolutin is done.
I am curious what value of DEVPATH was passed by kernel this time?
--
vda
More information about the busybox
mailing list