Skip to content

nfsdtop.linux does not count NFS4 write traffic #3

@rrzefox

Description

@rrzefox

I think I have found a bug in nfsdtop.linux: It currently does not count any NFS4 write traffic.

Looking at the code, I see the following in kprobe:nfsd4_write:

@nfsd4_write_count[tid] = $nfsd4_write->wr_bytes_written;

That seems wrong. When the write function is entered, obviously 0 bytes have been written so far. We would need to read wr_bytes_written when the function returns instead, it will always contain 0 before the function runs.

As a workaround, I tried resorting to $nfsd4_write->wr_buflen instead. That does yield results that look far more in line with the actual network and disc traffic of the server I tried this on - but obviously it is prone to overcounting if not all bytes are written, e.g. because the user exceeded the quota. I'm unsure if there is a better fix, otherwise I'd propose a patch.

Thanks for this great tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions