Commit 86dbd08b authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Print an error in the syslog when state is marked as irrecoverable

When error recovery fails due to a fatal error on the server, ensure
we log it in the syslog.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 5eb8d18c
...@@ -1463,7 +1463,7 @@ void nfs_inode_find_state_and_recover(struct inode *inode, ...@@ -1463,7 +1463,7 @@ void nfs_inode_find_state_and_recover(struct inode *inode,
nfs4_schedule_state_manager(clp); nfs4_schedule_state_manager(clp);
} }
static void nfs4_state_mark_open_context_bad(struct nfs4_state *state) static void nfs4_state_mark_open_context_bad(struct nfs4_state *state, int err)
{ {
struct inode *inode = state->inode; struct inode *inode = state->inode;
struct nfs_inode *nfsi = NFS_I(inode); struct nfs_inode *nfsi = NFS_I(inode);
...@@ -1474,6 +1474,8 @@ static void nfs4_state_mark_open_context_bad(struct nfs4_state *state) ...@@ -1474,6 +1474,8 @@ static void nfs4_state_mark_open_context_bad(struct nfs4_state *state)
if (ctx->state != state) if (ctx->state != state)
continue; continue;
set_bit(NFS_CONTEXT_BAD, &ctx->flags); set_bit(NFS_CONTEXT_BAD, &ctx->flags);
pr_warn("NFSv4: state recovery failed for open file %pd2, "
"error = %d\n", ctx->dentry, err);
} }
rcu_read_unlock(); rcu_read_unlock();
} }
...@@ -1481,7 +1483,7 @@ static void nfs4_state_mark_open_context_bad(struct nfs4_state *state) ...@@ -1481,7 +1483,7 @@ static void nfs4_state_mark_open_context_bad(struct nfs4_state *state)
static void nfs4_state_mark_recovery_failed(struct nfs4_state *state, int error) static void nfs4_state_mark_recovery_failed(struct nfs4_state *state, int error)
{ {
set_bit(NFS_STATE_RECOVERY_FAILED, &state->flags); set_bit(NFS_STATE_RECOVERY_FAILED, &state->flags);
nfs4_state_mark_open_context_bad(state); nfs4_state_mark_open_context_bad(state, error);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment