mbox series

[0/1] NFS: Fix read_bytes for buffered reads

Message ID 20230309185852.1151546-1-dwysocha@redhat.com (mailing list archive)
Headers show
Series NFS: Fix read_bytes for buffered reads | expand

Message

David Wysochanski March 9, 2023, 6:58 p.m. UTC
This patch fixes the read_bytes count for NFS buffered reads.
Simple reproducer follows.

Before this patch:
# mount 127.0.0.1:/ /mnt/nfs
# bash
# function dump_stats { cat /proc/$$/io; }
# trap dump_stats EXIT
# cat /mnt/nfs/file1.bin > /dev/null
# exit
exit
rchar: 3587436
wchar: 1054077
syscr: 544
syscw: 33
read_bytes: 0
write_bytes: 0
cancelled_write_bytes: 0


After this patch:
# mount 127.0.0.1:/ /mnt/nfs
# bash
# function dump_stats { cat /proc/$$/io; }
# trap dump_stats EXIT
# cat /mnt/nfs/file1.bin > /dev/null
# exit
exit
rchar: 3587278
wchar: 1054161
syscr: 544
syscw: 33
read_bytes: 1048576
write_bytes: 0
cancelled_write_bytes: 0


Dave Wysochanski (1):
  NFS: Fix /proc/PID/io read_bytes for buffered reads

 fs/nfs/read.c | 3 +++
 1 file changed, 3 insertions(+)