From: Greg KH <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk,
Trond Myklebust <Trond.Myklebust@netapp.com>,
Chuck Lever <chuck.lever@oracle.com>
Subject: [04/21] NFSv4: The state manager shouldnt exit on errors that were handled
Date: Fri, 10 Feb 2012 14:47:43 -0800 [thread overview]
Message-ID: <20120210224851.179969794@clark.kroah.org> (raw)
In-Reply-To: <20120210224858.GA30752@kroah.com>
2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <Trond.Myklebust@netapp.com>
commit 4f7cdf18e14f81860b856ef7694ef58eb1a751c0 upstream.
nfs4_recovery_handle_error() will correctly handle errors such as
NFS4ERR_CB_PATH_DOWN, however because they are still passed back to the
main loop in nfs4_state_manager(), they can cause the latter to exit
prematurely.
Fix this by letting nfs4_recovery_handle_error() change the error value in
cases where there is no action required by the caller.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/nfs4state.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1051,12 +1051,12 @@ static void nfs4_state_end_reclaim_nogra
clear_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state);
}
-static void nfs4_recovery_handle_error(struct nfs_client *clp, int error)
+static int nfs4_recovery_handle_error(struct nfs_client *clp, int error)
{
switch (error) {
case -NFS4ERR_CB_PATH_DOWN:
nfs_handle_cb_pathdown(clp);
- break;
+ return 0;
case -NFS4ERR_STALE_CLIENTID:
case -NFS4ERR_LEASE_MOVED:
set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
@@ -1075,6 +1075,7 @@ static void nfs4_recovery_handle_error(s
case -NFS4ERR_SEQ_MISORDERED:
set_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state);
}
+ return error;
}
static int nfs4_do_reclaim(struct nfs_client *clp, const struct nfs4_state_recovery_ops *ops)
@@ -1094,8 +1095,7 @@ restart:
if (status < 0) {
set_bit(ops->owner_flag_bit, &sp->so_flags);
nfs4_put_state_owner(sp);
- nfs4_recovery_handle_error(clp, status);
- return status;
+ return nfs4_recovery_handle_error(clp, status);
}
nfs4_put_state_owner(sp);
goto restart;
@@ -1125,8 +1125,7 @@ static int nfs4_check_lease(struct nfs_c
status = ops->renew_lease(clp, cred);
put_rpccred(cred);
out:
- nfs4_recovery_handle_error(clp, status);
- return status;
+ return nfs4_recovery_handle_error(clp, status);
}
static int nfs4_reclaim_lease(struct nfs_client *clp)
next prev parent reply other threads:[~2012-02-10 22:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-10 22:48 [00/21] 2.6.32.57-longterm review Greg KH
2012-02-10 22:47 ` [01/21] IB/mlx4: pass SMP vendor-specific attribute MADs to firmware Greg KH
2012-02-10 22:47 ` [02/21] mm/filemap_xip.c: fix race condition in xip_file_fault() Greg KH
2012-02-10 22:47 ` [03/21] NFSv4: Fix up the callers of nfs4_state_end_reclaim_reboot Greg KH
2012-02-10 22:47 ` Greg KH [this message]
2012-02-10 22:47 ` [05/21] NFSv4: Ensure the state manager handles NFS4ERR_NO_GRACE correctly Greg KH
2012-02-10 22:47 ` [06/21] NFSv4: Handle NFS4ERR_GRACE when recovering an expired lease Greg KH
2012-02-10 22:47 ` [07/21] NFSv4: Fix open recovery Greg KH
2012-02-10 22:47 ` [08/21] rpc client can not deal with ENOSOCK, so translate it into ENOCONN Greg KH
2012-02-10 22:47 ` [09/21] udf: Mark LVID buffer as uptodate before marking it dirty Greg KH
2012-02-10 22:47 ` [10/21] drm/i915: Fix TV Out refresh rate Greg KH
2012-02-10 22:47 ` [11/21] eCryptfs: Infinite loop due to overflow in ecryptfs_write() Greg KH
2012-02-10 22:47 ` [12/21] atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume Greg KH
2012-02-10 22:47 ` [13/21] Staging: asus_oled: fix image processing Greg KH
2012-02-10 22:47 ` [14/21] Staging: android: binder: Dont call dump_stack in binder_vma_open Greg KH
2012-02-10 22:47 ` [15/21] Staging: android: binder: Fix crashes when sharing a binder file between processes Greg KH
2012-02-10 22:47 ` [16/21] usb: gadget: zero: fix bug in loopback autoresume handling Greg KH
2012-02-10 22:47 ` [17/21] usb: Skip PCI USB quirk handling for Netlogic XLP Greg KH
2012-02-10 22:47 ` [18/21] USB: usbserial: add new PID number (0xa951) to the ftdi driver Greg KH
2012-02-10 22:47 ` [19/21] mmc: cb710 core: Add missing spin_lock_init for irq_lock of struct cb710_chip Greg KH
2012-02-10 22:47 ` [20/21] net: fix sk_forward_alloc corruptions Greg KH
2012-02-10 22:48 ` [21/21] net: sock_queue_err_skb() dont mess with sk_forward_alloc Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120210224851.179969794@clark.kroah.org \
--to=gregkh@linuxfoundation.org \
--cc=Trond.Myklebust@netapp.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=chuck.lever@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).