]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFS: finish_automount() requires us to hold 2 refs to the mount record
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 2 Apr 2020 14:34:36 +0000 (10:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:12:19 +0000 (16:12 +0200)
commit41d4cc6b58d07a7bba98c4da607370d66841f1cd
tree8b7ef9d9efc8bdd84cdbb8bd61b112b541283fc5
parenta976b33092783229413f5e8beaec63b79ed043f6
NFS: finish_automount() requires us to hold 2 refs to the mount record

[ Upstream commit 75da98586af75eb80664714a67a9895bf0a5517e ]

We must not return from nfs_d_automount() without holding 2 references
to the mount record. Doing so, will trigger the BUG() in finish_automount().
Also ensure that we don't try to reschedule the automount timer with
a negative or zero timeout value.

Fixes: 22a1ae9a93fb ("NFS: If nfs_mountpoint_expiry_timeout < 0, do not expire submounts")
Cc: stable@vger.kernel.org # v5.5+
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/namespace.c