[BusyBox] [PATCH RESEND] bug in find_real_root_device.c and code clean up

Tito farmatito at tiscali.it
Tue Aug 3 13:50:14 UTC 2004


On Tuesday 03 August 2004 OO:13, Erik Andersen wrote:
> On Sun Aug 01, 2004 at 01:39:28PM +0000, Tito wrote:
> > Hi to all,
> > This patch is useful for:
> > 1) remove an unused var from extern char *find_real_root_device_name(const char* name)
> >     changing it to extern char *find_real_root_device_name(void).
> > 2) fixes include/libbb.h, coreutils/df.c, util-linux/mount.c and  util-linux/umount.c accordingly.
> 
> Great.
> 
> > 3) fixes a bug, really a false positive,  in
> > find_real_root_device_name() that happens if in the /dev
> > directory exists a link named root (/dev/root) that should be
> > skipped but is not. This affects applets like df that display
> > wrong results like
> 
> Why would someone purposefully create a /dev/root device node?
> And if they did purposefully create it, why not use it?
> Is this a devfs thing?
Hi,
Maybe it is due to the use of an initrd as there is also: 
lr-xr-xr-x  1 root root 33 Aug  3 13:33 /dev/root -> ide/host0/bus0/target1/lun0/part1
lr-xr-xr-x  1 root root  4 Aug  3 13:33 /dev/root.old -> rd/0
Have to look in the initscripts and in devfsd.conf.
 
But the issue remains independently of the name of the link as long as it
is parsed by the readdir() call before the real node.
In fact I tried also another fix using xreadlink() but I wasn't sure
if this introduces to much bloat. 
If you think xreadlink is ok I can send a patch.
 Ciao, Tito
>  -Erik
> 
> --
> Erik B. Andersen             http://codepoet-consulting.com/
> --This message was written using 73% post-consumer electrons--
> 
> 



More information about the busybox mailing list