]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Don't loop forever in nfs_do_recoalesce()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 26 Mar 2022 01:51:03 +0000 (21:51 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 26 Mar 2022 01:51:03 +0000 (21:51 -0400)
commit9826905d8f3aa63ffa4066e031da2a3f26fb5986
treec034d37b54d828e10249433b6ad58dcc5252f500
parent1df6654d5dd3619cb50ca382d4948e0cf7685662
NFS: Don't loop forever in nfs_do_recoalesce()

If __nfs_pageio_add_request() fails to add the request, it will return
with either desc->pg_error < 0, or mirror->pg_recoalesce will be set, so
we are guaranteed either to exit the function altogether, or to loop.

However if there is nothing left in mirror->pg_list to coalesce, we must
exit, so make sure that we clear mirror->pg_recoalesce every time we
loop.

Reported-by: Olga Kornievskaia <aglo@umich.edu>
Fixes: 0d56ad2daeb4 ("NFS: Clean up reset of the mirror accounting variables")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/pagelist.c