1 Star 0 Fork 7

wangkang101 / lxcfs

forked from src-openEuler / lxcfs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0014-fix-proc-diskstats-show-in-container.patch 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
wangkang101 提交于 2020-08-28 15:17 . update to 4.0.5
diff --git a/src/proc_fuse.c b/src/proc_fuse.c
index 4ceea4c..519cda4 100644
--- a/src/proc_fuse.c
+++ b/src/proc_fuse.c
@@ -686,11 +686,16 @@ static int proc_diskstats_read(char *buf, size_t size, off_t offset,
tot_ticks = tot_ticks/1000000;
memset(lbuf, 0, 256);
- if (read || write || read_merged || write_merged || read_sectors || write_sectors || read_ticks || write_ticks)
+ if (read || write || read_merged || write_merged || read_sectors || write_sectors || read_ticks || write_ticks) {
+ if (need_record_diskstats(major, minor)) {
+ sscanf(line, "%u %u %71s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
+ &major, &minor, tmp_dev_name, &read, &read_merged, &read_sectors, &read_ticks,
+ &write, &write_merged, &write_sectors, &write_ticks, &ios_pgr, &tot_ticks, &rq_ticks);
+ }
snprintf(lbuf, 256, "%u %u %s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
major, minor, dev_name, read, read_merged, read_sectors, read_ticks,
write, write_merged, write_sectors, write_ticks, ios_pgr, tot_ticks, rq_ticks);
- else if (need_record_diskstats(major, minor)) {
+ } else if (need_record_diskstats(major, minor)) {
sscanf(line, "%u %u %71s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
&major, &minor, tmp_dev_name, &read, &read_merged, &read_sectors, &read_ticks,
&write, &write_merged, &write_sectors, &write_ticks, &ios_pgr, &tot_ticks, &rq_ticks);
1
https://gitee.com/wangkang101/lxcfs.git
git@gitee.com:wangkang101/lxcfs.git
wangkang101
lxcfs
lxcfs
master

搜索帮助