NFSD: Fix error return code in nfsd4_interssc_connect()
authorWei Yongjun <weiyongjun1@huawei.com>
Fri, 4 Jun 2021 10:12:37 +0000 (10:12 +0000)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 7 Jul 2021 00:14:41 +0000 (20:14 -0400)
'status' has been overwritten to 0 after nfsd4_ssc_setup_dul(), this
cause 0 will be return in vfs_kern_mount() error case. Fix to return
nfserr_nodev in this error.

Fixes: f4e44b393389 ("NFSD: delay unmount source's export after inter-server copy completed.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c

index af48fc8..a0d67ba 100644 (file)
@@ -1323,6 +1323,7 @@ nfsd4_interssc_connect(struct nl4_server *nss, struct svc_rqst *rqstp,
        ss_mnt = vfs_kern_mount(type, SB_KERNMOUNT, dev_name, raw_data);
        module_put(type->owner);
        if (IS_ERR(ss_mnt)) {
+               status = nfserr_nodev;
                if (work)
                        nfsd4_ssc_cancel_dul_work(nn, work);
                goto out_free_devname;