From: Kevin Constantine <Kevin.Constantine@disneyanimation.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org, steved@redhat.com
Subject: Re: [PATCH 1/1] nfs-iostat.py: Fixes several Divide by Zero errors
Date: Fri, 28 May 2010 15:51:58 -0700 [thread overview]
Message-ID: <4C00490E.3030801@disney.com> (raw)
In-Reply-To: <4BFFF6A8.2090103@oracle.com>
On 05/28/2010 10:00 AM, Chuck Lever wrote:
> On 05/27/10 08:50 PM, Kevin Constantine wrote:
>> The first time through the code sample_time is set to 0.0 on line 588.
>> Eventually we call display_iostats() and check if sample_time == 0. It
>> does, so we set sample_time equal to the mount age on line 368. I'm
>> seeing instances where the age of a mount is 0.
>>
>> cat /proc/self/mountstats | egrep "device|age"
>> device fashome-n1:/vol/home/fahome mounted on /home/fahome with fstype
>> nfs statvers=1.0
>> age: 0
>>
>> All of our storage is automounted, so volumes are frequently getting
>> unmounted and remounted.
>
> Makes sense. When I wrote the script, I wasn't using automounter at all.
> It might be simpler to have one check for a zero age at 368.
>
My only concern with checking and just returning (which is certainly
easier and a smaller change) is that we end up not printing anything for
a volume that is technically mounted. I figured it was better to print
the volume info and all zeroes than to not print anything.
I'll defer to your opinion on which of those two is best.
-kevin
>> On 05/27/2010 05:22 PM, Chuck Lever wrote:
>>> On 05/27/2010 07:58 PM, Kevin Constantine wrote:
>>>> There was no check to see if sample_time was zero before dividing by
>>>> it.
>>>
>>> I haven't looked at this code in a very long time. Why was sample_time
>>> zero? That seems wrong.
>>>
>>>> This was causing ZeroDivisionError's:
>>>>
next prev parent reply other threads:[~2010-05-28 22:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-27 23:58 [PATCH 1/1] nfs-iostat.py: Fixes several Divide by Zero errors Kevin Constantine
[not found] ` <1275004718-1802-1-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2010-05-28 0:22 ` Chuck Lever
2010-05-28 0:50 ` Kevin Constantine
2010-05-28 17:00 ` Chuck Lever
2010-05-28 22:51 ` Kevin Constantine [this message]
2010-06-01 15:37 ` Chuck Lever
2010-06-02 17:13 ` Kevin Constantine
2010-06-07 22:40 ` [PATCH 1/1] nfs-iostat.py: divide by zero with fresh mount Kevin Constantine
[not found] ` <1275950427-10200-1-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2010-06-07 23:12 ` Chuck Lever
2010-06-22 21:52 ` Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C00490E.3030801@disney.com \
--to=kevin.constantine@disneyanimation.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.