Loading fs/nfs/nfs4state.c +10 −1 Original line number Original line Diff line number Diff line Loading @@ -893,11 +893,15 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs * recovering after a network partition or a reboot from a * recovering after a network partition or a reboot from a * server that doesn't support a grace period. * server that doesn't support a grace period. */ */ restart: spin_lock(&sp->so_lock); list_for_each_entry(state, &sp->so_states, open_states) { list_for_each_entry(state, &sp->so_states, open_states) { if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) continue; continue; if (state->state == 0) if (state->state == 0) continue; continue; atomic_inc(&state->count); spin_unlock(&sp->so_lock); status = ops->recover_open(sp, state); status = ops->recover_open(sp, state); if (status >= 0) { if (status >= 0) { status = nfs4_reclaim_locks(state, ops); status = nfs4_reclaim_locks(state, ops); Loading @@ -907,7 +911,8 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs printk("%s: Lock reclaim failed!\n", printk("%s: Lock reclaim failed!\n", __func__); __func__); } } continue; nfs4_put_open_state(state); goto restart; } } } } switch (status) { switch (status) { Loading Loading @@ -935,9 +940,13 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs case -NFS4ERR_STALE_CLIENTID: case -NFS4ERR_STALE_CLIENTID: goto out_err; goto out_err; } } nfs4_put_open_state(state); goto restart; } } spin_unlock(&sp->so_lock); return 0; return 0; out_err: out_err: nfs4_put_open_state(state); return status; return status; } } Loading Loading
fs/nfs/nfs4state.c +10 −1 Original line number Original line Diff line number Diff line Loading @@ -893,11 +893,15 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs * recovering after a network partition or a reboot from a * recovering after a network partition or a reboot from a * server that doesn't support a grace period. * server that doesn't support a grace period. */ */ restart: spin_lock(&sp->so_lock); list_for_each_entry(state, &sp->so_states, open_states) { list_for_each_entry(state, &sp->so_states, open_states) { if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) continue; continue; if (state->state == 0) if (state->state == 0) continue; continue; atomic_inc(&state->count); spin_unlock(&sp->so_lock); status = ops->recover_open(sp, state); status = ops->recover_open(sp, state); if (status >= 0) { if (status >= 0) { status = nfs4_reclaim_locks(state, ops); status = nfs4_reclaim_locks(state, ops); Loading @@ -907,7 +911,8 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs printk("%s: Lock reclaim failed!\n", printk("%s: Lock reclaim failed!\n", __func__); __func__); } } continue; nfs4_put_open_state(state); goto restart; } } } } switch (status) { switch (status) { Loading Loading @@ -935,9 +940,13 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs case -NFS4ERR_STALE_CLIENTID: case -NFS4ERR_STALE_CLIENTID: goto out_err; goto out_err; } } nfs4_put_open_state(state); goto restart; } } spin_unlock(&sp->so_lock); return 0; return 0; out_err: out_err: nfs4_put_open_state(state); return status; return status; } } Loading