pnfs: Fix a problem where we gratuitously start doing I/O through the MDS
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 18 Jul 2019 19:33:42 +0000 (15:33 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:14:23 +0000 (09:14 +0200)
commit 58bbeab425c6c5e318f5b6ae31d351331ddfb34b upstream.

If the client has to stop in pnfs_update_layout() to wait for another
layoutget to complete, it currently exits and defaults to I/O through
the MDS if the layoutget was successful.

Fixes: d03360aaf5cc ("pNFS: Ensure we return the error if someone kills...")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: stable@vger.kernel.org # v4.20+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pnfs.c

index 1aa628c..4931c3a 100644 (file)
@@ -1867,7 +1867,7 @@ lookup_again:
                spin_unlock(&ino->i_lock);
                lseg = ERR_PTR(wait_var_event_killable(&lo->plh_outstanding,
                                        !atomic_read(&lo->plh_outstanding)));
-               if (IS_ERR(lseg) || !list_empty(&lo->plh_segs))
+               if (IS_ERR(lseg))
                        goto out_put_layout_hdr;
                pnfs_put_layout_hdr(lo);
                goto lookup_again;