NFS: nfs_set_pgio_error sometimes misses errors
authorTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 17 Aug 2015 17:57:07 +0000 (12:57 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2015 10:07:31 +0000 (12:07 +0200)
commit690eb5ee31ee70eb31565de1052147e20cc40ff0
tree665a0f5085309e152f5e586e1b302d9fe43e9ac2
parent9520ac796ef656c8ca8f7b0dfc56651f185d845f
NFS: nfs_set_pgio_error sometimes misses errors

commit e9ae58aeee8842a50f7e199d602a5ccb2e41a95f upstream.

We should ensure that we always set the pgio_header's error field
if a READ or WRITE RPC call returns an error. The current code depends
on 'hdr->good_bytes' always being initialised to a large value, which
is not always done correctly by callers.
When this happens, applications may end up missing important errors.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pagelist.c