[Regression] util-linux-2.27: zramctl lists same info for all devices (DATA COMPR TOTAL)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear util-linux developers, 

after updating to util-linux 2.7, zramctl output is broken if one just lists all devices: 

# zramctl 
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4             2G   4K   64B    4K       4 [SWAP]
/dev/zram1 lz4            12G   4K   64B    4K       4 /var/tmp/portage
/dev/zram2 lz4            12G   4K   64B    4K       4 /var/tmp/olifre

Compare this to:
# zramctl /dev/zram0
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4             2G   4K   64B    4K       4 [SWAP]

# zramctl /dev/zram1
NAME       ALGORITHM DISKSIZE  DATA  COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram1 lz4            12G  4,6M 202,5K  476K       4 /var/tmp/portage

i.e. it seems that in "listing" mode (no device given) it always shows the same information in DATA, COMPR and TOTAL columns for all devices. 
This is with kernel 4.2, /sys/block/zram1/mm_stat etc. behave correctly. 

I guess it is related to commit 5388c862607ec4f25f3e7ad23ab858b696bde1a1 . 
It parses mmstat and fills in z->mm_stat and z->mm_stat_probed only the first time get_mm_stat is called. Since the codes reuses the very same zram-struct "z" afterwards and z->mm_stat is never freed (and z->mm_stat_probed is never reset), only the first device is every queried. 

This was working fine with util-linux 2.6 which did not use this function yet. 

Cheers, 
Oliver

PS: I am not subscribed to util-linux, so please include me in replies. 
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux