Commit f639557
pNFS: Fix a hang in nfs4_evict_inode()
We are not allowed to call pnfs_mark_matching_lsegs_return() without
also holding a reference to the layout header, since doing so could lead
to the reference count going to zero when we call
pnfs_layout_remove_lseg(). This again can lead to a hang when we get to
nfs4_evict_inode() and are unable to clear the layout pointer.
pnfs_layout_return_unused_byserver() is guilty of this behaviour, and
has been seen to trigger the refcount warning prior to a hang.
Fixes: b6d49ec ("NFSv4: Fix a pNFS layout related use-after-free race when freeing the inode")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>1 parent 6a6d464 commit f639557
1 file changed
Lines changed: 23 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2634 | 2634 | | |
2635 | 2635 | | |
2636 | 2636 | | |
2637 | | - | |
2638 | | - | |
| 2637 | + | |
| 2638 | + | |
2639 | 2639 | | |
2640 | 2640 | | |
| 2641 | + | |
2641 | 2642 | | |
2642 | 2643 | | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
2643 | 2647 | | |
2644 | 2648 | | |
2645 | 2649 | | |
2646 | | - | |
| 2650 | + | |
| 2651 | + | |
2647 | 2652 | | |
2648 | 2653 | | |
2649 | | - | |
2650 | 2654 | | |
2651 | | - | |
| 2655 | + | |
| 2656 | + | |
2652 | 2657 | | |
2653 | 2658 | | |
2654 | 2659 | | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
2655 | 2671 | | |
2656 | | - | |
2657 | | - | |
2658 | | - | |
2659 | 2672 | | |
2660 | | - | |
2661 | | - | |
| 2673 | + | |
| 2674 | + | |
2662 | 2675 | | |
2663 | 2676 | | |
2664 | 2677 | | |
| |||
0 commit comments