NFS4 clients cannot reclaim locks
Subsystems (2)
NFS4 clients appear to have problems reclaiming locks after a server reboot. I can recreate the issue on 2.6.34.7-56.fc13.x86_64 on a Fedora system.
The problem appears to happen in cases where after a reboot, a WRITE call is made just before the RENEW call. In that case, the NFS4ERR_STALE_STATEID is returned for the WRITE call which results in NFS_STATE_RECLAIM_REBOOT being set in the state flags. However the NFS4ERR_STALE_CLIENTID returned for the subsequent RENEW call is handled by nfs4_recovery_handle_error() -> nfs4_state_end_reclaim_reboot(clp);
which ends up setting the state flag to NFS_STATE_RECLAIM_NOGRACE and clearing the NFS_STATE_RECLAIM_REBOOT in nfs4_state_mark_reclaim_nograce().
The process of reclaiming the locks then seem to hit another roadblock in nfs4_open_expired() where it fails to open the file and reset the state. It ends up calling nfs4_reclaim_locks() in a loop with the old stateid in nfs4_reclaim_open_state().
By commenting out the call to nfs4_state_end_reclaim_reboot(clp) in nfs4_recovery_handle_error(), the client was able to handle this particular scenario properly.
Has any one else seen this issue?
Sachin Prabhu
Quoted 5 lines · Sachin Prabhu
NFS4 clients appear to have problems reclaiming locks after a server reboot. I can recreate the issue on 2.6.34.7-56.fc13.x86_64 on a Fedora system.
The problem appears to happen in cases where after a reboot, a WRITE call is made just before the RENEW call. In that case, the
NFS4ERR_STALE_STATEIDis returned for the WRITE call which results inNFS_STATE_RECLAIM_REBOOTbeing set in the state flags. However theNFS4ERR_STALE_CLIENTIDreturned for the subsequent RENEW call is handled bynfs4_recovery_handle_error()->nfs4_state_end_reclaim_reboot(clp);
which ends up setting the state flag toNFS_STATE_RECLAIM_NOGRACEand clearing theNFS_STATE_RECLAIM_REBOOTinnfs4_state_mark_reclaim_nograce().
Yup. I don't think we should call nfs4_state_mark_reclaim_reboot() here.
Quoted 1 line
The process of reclaiming the locks then seem to hit another roadblock in
nfs4_open_expired()where it fails to open the file and reset the state. It ends up callingnfs4_reclaim_locks()in a loop with the old stateid innfs4_reclaim_open_state().
Any idea how nfs4_open_expired() is failing? It seems that if it does, we should see an error, which would cause the lock reclaim to fail.
Also, why is the call to nfs4_reclaim_locks() looping? That too should exit in case of an error.
Quoted 1 line
By commenting out the call to
nfs4_state_end_reclaim_reboot(clp)innfs4_recovery_handle_error(), the client was able to handle this particular scenario properly.
We do need to keep the nfs4_state_end_reclaim_reboot() there. Otherwise, we have a problem if the server reboots again while we're in the middle of reclaiming state.
Cheers
Trond
Quoted 11 lines · Sachin Prabhu
NFS4 clients appear to have problems reclaiming locks after a server reboot. I can recreate the issue on 2.6.34.7-56.fc13.x86_64 on a Fedora system.
The problem appears to happen in cases where after a reboot, a WRITE call is made just before the RENEW call. In that case, the
NFS4ERR_STALE_STATEIDis returned for the WRITE call which results inNFS_STATE_RECLAIM_REBOOTbeing set in the state flags. However theNFS4ERR_STALE_CLIENTIDreturned for the subsequent RENEW call is handled bynfs4_recovery_handle_error()->nfs4_state_end_reclaim_reboot(clp);
which ends up setting the state flag toNFS_STATE_RECLAIM_NOGRACEand clearing theNFS_STATE_RECLAIM_REBOOTinnfs4_state_mark_reclaim_nograce().The process of reclaiming the locks then seem to hit another roadblock in
nfs4_open_expired()where it fails to open the file and reset the state. It ends up callingnfs4_reclaim_locks()in a loop with the old stateid innfs4_reclaim_open_state().By commenting out the call to
nfs4_state_end_reclaim_reboot(clp)innfs4_recovery_handle_error(), the client was able to handle this particular scenario properly.Has any one else seen this issue?
could this be related to the bug I was seeing with nfsv4 (now using v3 with success):
https://bugzilla.kernel.org/show_bug.cgi?id=15973
though the error returned by the server is BAD_STATEID..
Signature · 2 lines
Timo Aaltonen Systems Specialist, Aalto IT
Quoted 12 lines · Timo Aaltonen
Quoted 10 lines · Sachin Prabhu
NFS4 clients appear to have problems reclaiming locks after a server reboot. I can recreate the issue on 2.6.34.7-56.fc13.x86_64 on a Fedora system.
The problem appears to happen in cases where after a reboot, a WRITE call is made just before the RENEW call. In that case, the
NFS4ERR_STALE_STATEIDis returned for the WRITE call which results inNFS_STATE_RECLAIM_REBOOTbeing set in the state flags. However theNFS4ERR_STALE_CLIENTIDreturned for the subsequent RENEW call is handled bynfs4_recovery_handle_error()->nfs4_state_end_reclaim_reboot(clp);
which ends up setting the state flag toNFS_STATE_RECLAIM_NOGRACEand clearing theNFS_STATE_RECLAIM_REBOOTinnfs4_state_mark_reclaim_nograce().The process of reclaiming the locks then seem to hit another roadblock in
nfs4_open_expired()where it fails to open the file and reset the state. It ends up callingnfs4_reclaim_locks()in a loop with the old stateid innfs4_reclaim_open_state().By commenting out the call to
nfs4_state_end_reclaim_reboot(clp)innfs4_recovery_handle_error(), the client was able to handle this particular scenario properly.
Quoted 7 lines
Quoted 1 line
Has any one else seen this issue?
could this be related to the bug I was seeing with nfsv4 (now using v3 with success):
https://bugzilla.kernel.org/show_bug.cgi?id=15973
though the error returned by the server is
BAD_STATEID..
At least testing .37rc2 has so far been positive, suggesting that the bug is fixed there.
Signature · 2 lines
Timo Aaltonen Systems Specialist, Aalto IT