[PATCH] find mount point of char devices

Denys Vlasenko vda.linux at googlemail.com
Wed Jan 18 00:50:11 UTC 2012


On Monday 09 January 2012 11:10, Javier Viguera wrote:
> Hi all,
> 
> I found a corner case in 'df' command when using it with an UBIFS partition.
> 
> If i use 'df' without arguments, i got the correct values:
> 
> / # df
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/root             72091984  12360980  56068924  18% /
> devtmpfs                115236         4    115232   0% /dev
> tmpfs                    28672        32     28640   0% /tmp
> /dev/ubi0_0             360268     18348    341920   5% /tmp/mnt/userfs
> 
> while if i just pass the ubi volume i got the wrong answer:
> 
> / # df /dev/ubi0_0
> Filesystem           1K-blocks      Used Available Use% Mounted on
> devtmpfs                115236         4    115232   0% /dev
> 
> 
> Coreutils 'df' seems to work properly:
> 
> / # /df --version
> df (GNU coreutils) 8.15
> ...
> 
> / # /df /dev/ubi0_0
> Filesystem     1K-blocks  Used Available Use% Mounted on
> /dev/ubi0_0       360268 18348    341920   6% /tmp/mnt/userfs
> 
> I tracked down the problem in busybox to the 'find_mount_point' function 
> where it checks if the device to find the mountpoint is a block device 
> or not. On UBI systems the volume to mount is a 'char' device:
> 
> / # ls -l /dev/ubi0_0
> crw-rw----    1 root     root      249,   1 Jan  4 21:42 /dev/ubi0_0
> 
> A basic patch that fixes the problem is attached (against current 
> master), but I'm not sure if this is the correct fix or not, so i just 
> send it here to review and consider applying.


Looks ok to me.

Applied, thanks.

-- 
vda



More information about the busybox mailing list