NFSv4/pNFS: Don't call _nfs4_pnfs_v3_ds_connect multiple times
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 3 Jul 2021 18:34:20 +0000 (14:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:53 +0000 (16:05 +0200)
commit4aa17d058a9b883bfe88d50fc0fe75e804fef701
tree9b77ec96669031b9f4f653d1fc19a87ea38479a4
parent885c0cc2acfe2c52253b80c92b53f63cbcbdcf31
NFSv4/pNFS: Don't call _nfs4_pnfs_v3_ds_connect multiple times

[ Upstream commit f46f84931a0aa344678efe412d4b071d84d8a805 ]

After we grab the lock in nfs4_pnfs_ds_connect(), there is no check for
whether or not ds->ds_clp has already been initialised, so we can end up
adding the same transports multiple times.

Fixes: fc821d59209d ("pnfs/NFSv4.1: Add multipath capabilities to pNFS flexfiles servers over NFSv3")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/pnfs_nfs.c