NFSv4.2 fix problems with __nfs42_ssc_open
authorOlga Kornievskaia <kolga@netapp.com>
Thu, 18 Aug 2022 19:07:05 +0000 (15:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:16:37 +0000 (17:16 +0200)
commit5626f95356111602ad26fc05445a4d1f818a0992
tree0157ad8b1271e502c9d866f688723ca8414d8ad2
parent519543a64650ff4c3630fa6601248d3c33b9ff08
NFSv4.2 fix problems with __nfs42_ssc_open

[ Upstream commit fcfc8be1e9cf2f12b50dce8b579b3ae54443a014 ]

A destination server while doing a COPY shouldn't accept using the
passed in filehandle if its not a regular filehandle.

If alloc_file_pseudo() has failed, we need to decrement a reference
on the newly created inode, otherwise it leaks.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Fixes: ec4b092508982 ("NFS: inter ssc open")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4file.c