On Wed, Oct 1, 2014 at 9:57 AM, Anna Schumaker <Anna.Schumaker@xxxxxxxxxx> wrote: > On 09/27/2014 11:54 PM, Trond Myklebust wrote: >> The current open/lock state recovery unfortunately does not handle errors >> such as NFS4ERR_CONN_NOT_BOUND_TO_SESSION correctly. Instead of looping, >> just proceeds as if the state manager is finished recovering. >> This patch ensures that we loop back, handle higher priority errors >> and complete the open/lock state recovery. >> >> Cc: stable@xxxxxxxxxxxxxxx >> Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx> >> --- >> fs/nfs/nfs4state.c | 16 ++++++---------- >> 1 file changed, 6 insertions(+), 10 deletions(-) >> >> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c >> index 26d510d11efd..87b2d0e79797 100644 >> --- a/fs/nfs/nfs4state.c >> +++ b/fs/nfs/nfs4state.c >> @@ -1705,7 +1705,8 @@ restart: >> if (status < 0) { >> set_bit(ops->owner_flag_bit, &sp->so_flags); >> nfs4_put_state_owner(sp); >> - return nfs4_recovery_handle_error(clp, status); >> + status = nfs4_recovery_handle_error(clp, status); >> + return (status != 0) ? status : -EAGAIN; > > Why is the ternary better than doing something like this? > > if (status == 0) > return -EAGAIN; > return status; It is 2 lines shorter, yet just as legible in this situation. -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.myklebust@xxxxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html