Trond Myklebust f8b746f5cf NFSv4/pNFS: Fix another issue with a list iterator pointing to the head
[ Upstream commit 7c9d845f0612e5bcd23456a2ec43be8ac43458f1 ]

In nfs4_callback_devicenotify(), if we don't find a matching entry for
the deviceid, we're left with a pointer to 'struct nfs_server' that
actually points to the list of super blocks associated with our struct
nfs_client.
Furthermore, even if we have a valid pointer, nothing pins the super
block, and so the struct nfs_server could end up getting freed while
we're using it.

Since all we want is a pointer to the struct pnfs_layoutdriver_type,
let's skip all the iteration over super blocks, and just use APIs to
find the layout driver directly.

Reported-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Fixes: 1be5683b03a7 ("pnfs: CB_NOTIFY_DEVICEID")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-15 14:14:53 +02:00
..
2020-11-05 11:08:53 +01:00
2021-06-30 08:48:14 -04:00
2019-08-06 19:06:51 +02:00
2021-09-22 11:48:02 +02:00
2022-04-15 14:14:53 +02:00
2020-03-05 16:42:12 +01:00
2020-03-25 08:06:14 +01:00
2021-05-22 10:59:50 +02:00
2021-12-14 10:18:07 +01:00