[procps] Re: [PING] [PATCH] libprocps: fix crash in getdiskstat() when /sys/block is not available

  • From: Craig Small <csmall-procps@xxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Thu, 30 Jan 2014 21:45:07 +1100

On Thu, Jan 24, 2013 at 05:26:09AM +0400, Dmitry V. Levin wrote:
> When /sys/block is not available, there is no reliable way to
> distingush disks from partitions.  The best thing to do in that
> unlikely case is to treat all devices as disks.
This report got missed but I have fixed this problem in a different way.
It is essentially treating everything like a partition (which is what
not having /sys/block does). My fix just checks for the absence of the
disk and doesn't link them.

Neither fix is completely correct. The right way would be to 
return something from the library that means there was an error
and get the program to handle it. But that needs an API change.

 - Craig

-- 
Craig Small (@smallsees)   http://enc.com.au/       csmall at : enc.com.au
Debian GNU/Linux           http://www.debian.org/   csmall at : debian.org
GPG fingerprint:        5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5

Other related posts: