Commit dfe1fe7
Trond Myklebust
NFSv4: Fix deadlock between nfs4_evict_inode() and nfs4_opendata_get_inode()
If the inode is being evicted, but has to return a delegation first,
then it can cause a deadlock in the corner case where the server reboots
before the delegreturn completes, but while the call to iget5_locked() in
nfs4_opendata_get_inode() is waiting for the inode free to complete.
Since the open call still holds a session slot, the reboot recovery
cannot proceed.
In order to break the logjam, we can turn the delegation return into a
privileged operation for the case where we're evicting the inode. We
know that in that case, there can be no other state recovery operation
that conflicts.
Reported-by: zhangxiaoxu (A) <zhangxiaoxu5@huawei.com>
Fixes: 5fcdfac ("NFSv4: Return delegations synchronously in evict_inode")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>1 parent d1b5c23 commit dfe1fe7
2 files changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| 592 | + | |
| 593 | + | |
592 | 594 | | |
593 | 595 | | |
594 | 596 | | |
| |||
614 | 616 | | |
615 | 617 | | |
616 | 618 | | |
| 619 | + | |
| 620 | + | |
617 | 621 | | |
618 | 622 | | |
619 | 623 | | |
| |||
6417 | 6421 | | |
6418 | 6422 | | |
6419 | 6423 | | |
| 6424 | + | |
6420 | 6425 | | |
6421 | 6426 | | |
6422 | 6427 | | |
| |||
6540 | 6545 | | |
6541 | 6546 | | |
6542 | 6547 | | |
6543 | | - | |
6544 | 6548 | | |
6545 | 6549 | | |
6546 | 6550 | | |
| |||
6571 | 6575 | | |
6572 | 6576 | | |
6573 | 6577 | | |
| 6578 | + | |
| 6579 | + | |
| 6580 | + | |
| 6581 | + | |
| 6582 | + | |
| 6583 | + | |
6574 | 6584 | | |
6575 | 6585 | | |
6576 | 6586 | | |
| |||
0 commit comments