* Patch "pNFS: On error, do not send LAYOUTGET until the LAYOUTRETURN has completed" has been added to the 4.9-stable tree
@ 2017-01-06 15:31 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-01-06 15:31 UTC (permalink / raw)
To: trond.myklebust, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
pNFS: On error, do not send LAYOUTGET until the LAYOUTRETURN has completed
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
pnfs-on-error-do-not-send-layoutget-until-the-layoutreturn-has-completed.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 6604b203fb6394ed1f24c21bfa3c207e5ae8e461 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <trond.myklebust@primarydata.com>
Date: Mon, 17 Oct 2016 17:54:32 -0400
Subject: pNFS: On error, do not send LAYOUTGET until the LAYOUTRETURN has completed
From: Trond Myklebust <trond.myklebust@primarydata.com>
commit 6604b203fb6394ed1f24c21bfa3c207e5ae8e461 upstream.
If there is an I/O error, we should not call LAYOUTGET until the
LAYOUTRETURN that reports the error is complete.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/pnfs.c | 6 +++++-
fs/nfs/pnfs.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -944,6 +944,7 @@ static void pnfs_clear_layoutcommit(stru
void pnfs_clear_layoutreturn_waitbit(struct pnfs_layout_hdr *lo)
{
clear_bit_unlock(NFS_LAYOUT_RETURN, &lo->plh_flags);
+ clear_bit(NFS_LAYOUT_RETURN_LOCK, &lo->plh_flags);
smp_mb__after_atomic();
wake_up_bit(&lo->plh_flags, NFS_LAYOUT_RETURN);
rpc_wake_up(&NFS_SERVER(lo->plh_inode)->roc_rpcwaitq);
@@ -957,8 +958,9 @@ pnfs_prepare_layoutreturn(struct pnfs_la
/* Serialise LAYOUTGET/LAYOUTRETURN */
if (atomic_read(&lo->plh_outstanding) != 0)
return false;
- if (test_and_set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags))
+ if (test_and_set_bit(NFS_LAYOUT_RETURN_LOCK, &lo->plh_flags))
return false;
+ set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags);
pnfs_get_layout_hdr(lo);
if (test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags)) {
if (stateid != NULL) {
@@ -1950,6 +1952,8 @@ void pnfs_error_mark_layout_for_return(s
spin_lock(&inode->i_lock);
pnfs_set_plh_return_info(lo, range.iomode, 0);
+ /* Block LAYOUTGET */
+ set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags);
/*
* mark all matching lsegs so that we are sure to have no live
* segments at hand when sending layoutreturn. See pnfs_put_lseg()
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -96,6 +96,7 @@ enum {
NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */
NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */
NFS_LAYOUT_RETURN, /* layoutreturn in progress */
+ NFS_LAYOUT_RETURN_LOCK, /* Serialise layoutreturn */
NFS_LAYOUT_RETURN_REQUESTED, /* Return this layout ASAP */
NFS_LAYOUT_INVALID_STID, /* layout stateid id is invalid */
NFS_LAYOUT_FIRST_LAYOUTGET, /* Serialize first layoutget */
Patches currently in stable-queue which might be from trond.myklebust@primarydata.com are
queue-4.9/pnfs-fix-a-deadlock-between-read-resends-and-layoutreturn.patch
queue-4.9/pnfs-don-t-clear-the-layout-stateid-if-a-layout-return-is-outstanding.patch
queue-4.9/sunrpc-fix-refcounting-problems-with-auth_gss-messages.patch
queue-4.9/pnfs-on-error-do-not-send-layoutget-until-the-layoutreturn-has-completed.patch
queue-4.9/pnfs-clear-nfs_layout_return_requested-when-invalidating-the-layout-stateid.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-06 15:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-06 15:31 Patch "pNFS: On error, do not send LAYOUTGET until the LAYOUTRETURN has completed" has been added to the 4.9-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).