BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000894 [BusyBox] Other minor always 06-02-06 07:55 11-15-07 01:46
Reporter aric View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version 1.1.x
Summary 0000894: df.c Does not report info for "rootfs"
Description df.c is explicitly set up to ignore "rootfs", and so if you df -h /, you get nothing. I think it was designed to skip the multiple entries of the root mount that appear in /proc/mounts and /etc/mtab, but it doesn't take care of the case when a path is specified.
Additional Information Here is a patch to fix it:
{{{
--- coreutils/df.c.original 2006-03-22 16:16:21.000000000 -0500
+++ coreutils/df.c 2006-06-02 10:52:54.000000000 -0400
@@ -60,6 +60,7 @@
        struct statfs s;
        static const char hdr_1k[] = "1k-blocks"; /* default display is kilobytes */
        const char *disp_units_hdr = hdr_1k;
+ int root_done = 0;
 
 #ifdef CONFIG_FEATURE_HUMAN_READABLE
        bb_opt_complementally = "h-km:k-hm:m-hk";
@@ -125,14 +126,14 @@
                                                                           ) / (blocks_used + s.f_bavail);
                        }
 
- if (strcmp(device, "rootfs") == 0) {
- continue;
- } else if (strcmp(device, "/dev/root") == 0) {
+ if (strcmp(device, "/dev/root") == 0 || strcmp(device, "rootfs") == 0) {
+ if(root_done) continue;
                                /* Adjusts device to be the real root device,
                                * or leaves device alone if it can't find it */
                                if ((device = find_block_device("/")) == NULL) {
                                        goto SET_ERROR;
                                }
+ root_done = 1;
                        }
 
 #ifdef CONFIG_FEATURE_HUMAN_READABLE
}}}
Attached Files  df.patch [^] (920 bytes) 06-02-06 07:58

- Relationships
duplicate of 0000145closed BusyBox Fix strange behavior when issue df with pseudo root device(/dev/root). 

- Notes
(0001393)
aric
06-02-06 07:58

That patch didn't look so good, so I attached a file.
 
(0002920)
vda
11-15-07 01:46

fixed in svn
 

- Issue History
Date Modified Username Field Change
06-02-06 07:55 aric New Issue
06-02-06 07:55 aric Status new => assigned
06-02-06 07:55 aric Assigned To  => BusyBox
06-02-06 07:58 aric File Added: df.patch
06-02-06 07:58 aric Note Added: 0001393
06-02-06 08:21 bernhardf Relationship added duplicate of 0000145
11-15-07 01:46 vda Status assigned => closed
11-15-07 01:46 vda Note Added: 0002920
11-15-07 01:46 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker