nfsd: fix kernel test robot warning in SSC code
authorDai Ngo <dai.ngo@oracle.com>
Fri, 4 Jun 2021 00:02:26 +0000 (20:02 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 7 Jul 2021 00:14:41 +0000 (20:14 -0400)
Fix by initializing pointer nfsd4_ssc_umount_item with NULL instead of 0.
Replace return value of nfsd4_ssc_setup_dul with __be32 instead of int.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4state.c

index 0bd71c6..af48fc8 100644 (file)
@@ -1175,7 +1175,7 @@ extern void nfs_sb_deactive(struct super_block *sb);
 /*
  * setup a work entry in the ssc delayed unmount list.
  */
-static int nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
+static __be32 nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
                struct nfsd4_ssc_umount_item **retwork, struct vfsmount **ss_mnt)
 {
        struct nfsd4_ssc_umount_item *ni = 0;
@@ -1399,7 +1399,7 @@ nfsd4_cleanup_inter_ssc(struct vfsmount *ss_mnt, struct nfsd_file *src,
        bool found = false;
        long timeout;
        struct nfsd4_ssc_umount_item *tmp;
-       struct nfsd4_ssc_umount_item *ni = 0;
+       struct nfsd4_ssc_umount_item *ni = NULL;
        struct nfsd_net *nn = net_generic(dst->nf_net, nfsd_net_id);
 
        nfs42_ssc_close(src->nf_file);
index 6c64ce9..980bd89 100644 (file)
@@ -5514,7 +5514,7 @@ EXPORT_SYMBOL_GPL(nfsd4_ssc_init_umount_work);
  */
 static void nfsd4_ssc_shutdown_umount(struct nfsd_net *nn)
 {
-       struct nfsd4_ssc_umount_item *ni = 0;
+       struct nfsd4_ssc_umount_item *ni = NULL;
        struct nfsd4_ssc_umount_item *tmp;
 
        spin_lock(&nn->nfsd_ssc_lock);