[LTP] [PATCH] lsmod01: parse a copy of /proc/modules

Jan Stancek jstancek@redhat.com
Mon Aug 29 15:34:54 CEST 2016





----- Original Message -----
> From: "Stanislav Kholmanskikh" <stanislav.kholmanskikh@oracle.com>
> To: "Cyril Hrubis" <chrubis@suse.cz>
> Cc: "vasily isaenko" <vasily.isaenko@oracle.com>, ltp@lists.linux.it
> Sent: Monday, 29 August, 2016 3:05:11 PM
> Subject: Re: [LTP] [PATCH] lsmod01: parse a copy of /proc/modules
> 
> 
> 
> On 08/29/2016 03:50 PM, Cyril Hrubis wrote:
> > Hi!
> >> In my environment, if TMPDIR is on NFSv4, this test case fails with:
> >>
> >> lsmod01 1 TFAIL : lsmod output different from /proc/modules.
> >>   21c21
> >>   < sunrpc 207591 28
> >>   ---
> >>   > sunrpc 207591 29
> >>
> >> To avoid such problems I separate the process of getting data from
> >> /proc/modules and the process of parsing it in the pipe structure.
> > 
> > So the sunrpc module gets its ref counter incremented from somewhere of
> > the nfs kernel code once we open file on NFS?
> 
> Looks so. I hava a share mounted from localhost:
> 
> [root@skholman-m7 mnt]# mount|grep mnt
> 127.0.0.1:/opt on /mnt type nfs
> (rw,vers=4,addr=127.0.0.1,clientaddr=127.0.0.1)
> [root@skholman-m7 mnt]# awk '{print $1, $2, $3}' /proc/modules|sort >
> /tmp/not_nfs
> [root@skholman-m7 mnt]# awk '{print $1, $2, $3}' /proc/modules|sort > nfs
> [root@skholman-m7 mnt]# grep sunrpc nfs
> sunrpc 207591 29
> [root@skholman-m7 mnt]# grep sunrpc /tmp/not_nfs
> sunrpc 207591 28
> [root@skholman-m7 mnt]#

And if you do that with just "cat /proc/modules", then there's no difference?
Could it be that it's actually first write that takes extra ref?
cat is reading in 65536 byte chunks for me, awk only 1024.

Regards,
Jan

> 
> 
> 
> > 
> > But shouldn't the shell open the temp file the output is redirected to
> > before it executes the command line anyway?
> > 
> 
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
> 


More information about the ltp mailing list