Trond Myklebust f63955721a 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: b6d49ecd1081 ("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>
2023-10-18 14:41:52 -04:00
..
2017-11-17 14:18:00 -08:00
2017-11-17 14:18:00 -08:00
2023-08-29 17:45:22 -04:00
2023-08-24 13:24:15 -04:00
2021-04-05 09:04:20 -04:00
2023-03-06 09:57:12 +01:00
2022-10-20 10:13:27 +02:00
2023-03-06 09:57:12 +01:00
2023-06-19 15:10:45 -04:00
2023-10-18 14:41:52 -04:00
2022-05-09 16:36:48 -04:00
2023-08-19 10:26:29 -04:00
2022-11-27 22:10:00 -05:00