OSDN Git Service

NFS: Fix an Oopsable condition in __nfs_pageio_add_request()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 25 May 2021 14:23:05 +0000 (10:23 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 26 May 2021 10:36:13 +0000 (06:36 -0400)
commit56517ab958b7c11030e626250c00b9b1a24b41eb
tree9cfb4e7a5e6bca35bb48d3ff9c8b84d9e34b7e12
parente86be3a04bc4aeaf12f93af35f08f8d4385bcd98
NFS: Fix an Oopsable condition in __nfs_pageio_add_request()

Ensure that nfs_pageio_error_cleanup() resets the mirror array contents,
so that the structure reflects the fact that it is now empty.
Also change the test in nfs_pageio_do_add_request() to be more robust by
checking whether or not the list is empty rather than relying on the
value of pg_count.

Fixes: a7d42ddb3099 ("nfs: add mirroring support to pgio layer")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/pagelist.c