OSDN Git Service

nfs: fix DIO good bytes calculation
authorPeng Tao <tao.peng@primarydata.com>
Thu, 9 Apr 2015 15:02:16 +0000 (23:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:04:06 +0000 (22:04 +0200)
commitdcd8d0c80e86b8821c5a453b5bf782328d8580e1
tree4c06987b4944b6d218a41301fd3b478cf0470a98
parentc59908b7a9d4b76f72367f055559663e1da274fc
nfs: fix DIO good bytes calculation

commit 1ccbad9f9f9bd36db26a10f0b17fbaf12b3ae93a upstream.

For direct read that has IO size larger than rsize, we'll split
it into several READ requests and nfs_direct_good_bytes() would
count completed bytes incorrectly by eating last zero count reply.

Fix it by handling mirror and non-mirror cases differently such that
we only count mirrored writes differently.

This fixes 5fadeb47("nfs: count DIO good bytes correctly with mirroring").

Reported-by: Jean Spector <jean@primarydata.com>
Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/direct.c