All of lore.kernel.org
 help / color / mirror / Atom feed
* fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size
@ 2022-01-18 11:13 ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-01-18 11:13 UTC (permalink / raw)
  To: Dai Ngo; +Cc: kbuild-all, linux-kernel, J. Bruce Fields

Hi Dai,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e3a8b6a1e70c37702054ae3c7c07ed828435d8ee
commit: f4e44b393389c77958f7c58bf4415032b4cda15b NFSD: delay unmount source's export after inter-server copy completed.
date:   8 months ago
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20220118/202201181657.6QL0fpaT-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4e44b393389c77958f7c58bf4415032b4cda15b
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout f4e44b393389c77958f7c58bf4415032b4cda15b
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc SHELL=/bin/bash drivers/net/ethernet/mellanox/mlx5/core/esw/ drivers/net/wireless/broadcom/brcm80211/brcmfmac/ drivers/net/wireless/broadcom/brcm80211/brcmsmac/ drivers/net/wireless/intel/iwlwifi/ fs/nfsd/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   fs/nfsd/nfs4proc.c: In function 'nfsd4_ssc_setup_dul.constprop':
>> fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size [-Wstringop-truncation]
    1219 |                 strncpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr));
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +1219 fs/nfsd/nfs4proc.c

  1174	
  1175	/*
  1176	 * setup a work entry in the ssc delayed unmount list.
  1177	 */
  1178	static int nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
  1179			struct nfsd4_ssc_umount_item **retwork, struct vfsmount **ss_mnt)
  1180	{
  1181		struct nfsd4_ssc_umount_item *ni = 0;
  1182		struct nfsd4_ssc_umount_item *work = NULL;
  1183		struct nfsd4_ssc_umount_item *tmp;
  1184		DEFINE_WAIT(wait);
  1185	
  1186		*ss_mnt = NULL;
  1187		*retwork = NULL;
  1188		work = kzalloc(sizeof(*work), GFP_KERNEL);
  1189	try_again:
  1190		spin_lock(&nn->nfsd_ssc_lock);
  1191		list_for_each_entry_safe(ni, tmp, &nn->nfsd_ssc_mount_list, nsui_list) {
  1192			if (strncmp(ni->nsui_ipaddr, ipaddr, sizeof(ni->nsui_ipaddr)))
  1193				continue;
  1194			/* found a match */
  1195			if (ni->nsui_busy) {
  1196				/*  wait - and try again */
  1197				prepare_to_wait(&nn->nfsd_ssc_waitq, &wait,
  1198					TASK_INTERRUPTIBLE);
  1199				spin_unlock(&nn->nfsd_ssc_lock);
  1200	
  1201				/* allow 20secs for mount/unmount for now - revisit */
  1202				if (signal_pending(current) ||
  1203						(schedule_timeout(20*HZ) == 0)) {
  1204					kfree(work);
  1205					return nfserr_eagain;
  1206				}
  1207				finish_wait(&nn->nfsd_ssc_waitq, &wait);
  1208				goto try_again;
  1209			}
  1210			*ss_mnt = ni->nsui_vfsmount;
  1211			refcount_inc(&ni->nsui_refcnt);
  1212			spin_unlock(&nn->nfsd_ssc_lock);
  1213			kfree(work);
  1214	
  1215			/* return vfsmount in ss_mnt */
  1216			return 0;
  1217		}
  1218		if (work) {
> 1219			strncpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr));
  1220			refcount_set(&work->nsui_refcnt, 2);
  1221			work->nsui_busy = true;
  1222			list_add_tail(&work->nsui_list, &nn->nfsd_ssc_mount_list);
  1223			*retwork = work;
  1224		}
  1225		spin_unlock(&nn->nfsd_ssc_lock);
  1226		return 0;
  1227	}
  1228	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size
@ 2022-01-18 11:13 ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-01-18 11:13 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3993 bytes --]

Hi Dai,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e3a8b6a1e70c37702054ae3c7c07ed828435d8ee
commit: f4e44b393389c77958f7c58bf4415032b4cda15b NFSD: delay unmount source's export after inter-server copy completed.
date:   8 months ago
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20220118/202201181657.6QL0fpaT-lkp(a)intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4e44b393389c77958f7c58bf4415032b4cda15b
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout f4e44b393389c77958f7c58bf4415032b4cda15b
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc SHELL=/bin/bash drivers/net/ethernet/mellanox/mlx5/core/esw/ drivers/net/wireless/broadcom/brcm80211/brcmfmac/ drivers/net/wireless/broadcom/brcm80211/brcmsmac/ drivers/net/wireless/intel/iwlwifi/ fs/nfsd/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   fs/nfsd/nfs4proc.c: In function 'nfsd4_ssc_setup_dul.constprop':
>> fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size [-Wstringop-truncation]
    1219 |                 strncpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr));
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +1219 fs/nfsd/nfs4proc.c

  1174	
  1175	/*
  1176	 * setup a work entry in the ssc delayed unmount list.
  1177	 */
  1178	static int nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
  1179			struct nfsd4_ssc_umount_item **retwork, struct vfsmount **ss_mnt)
  1180	{
  1181		struct nfsd4_ssc_umount_item *ni = 0;
  1182		struct nfsd4_ssc_umount_item *work = NULL;
  1183		struct nfsd4_ssc_umount_item *tmp;
  1184		DEFINE_WAIT(wait);
  1185	
  1186		*ss_mnt = NULL;
  1187		*retwork = NULL;
  1188		work = kzalloc(sizeof(*work), GFP_KERNEL);
  1189	try_again:
  1190		spin_lock(&nn->nfsd_ssc_lock);
  1191		list_for_each_entry_safe(ni, tmp, &nn->nfsd_ssc_mount_list, nsui_list) {
  1192			if (strncmp(ni->nsui_ipaddr, ipaddr, sizeof(ni->nsui_ipaddr)))
  1193				continue;
  1194			/* found a match */
  1195			if (ni->nsui_busy) {
  1196				/*  wait - and try again */
  1197				prepare_to_wait(&nn->nfsd_ssc_waitq, &wait,
  1198					TASK_INTERRUPTIBLE);
  1199				spin_unlock(&nn->nfsd_ssc_lock);
  1200	
  1201				/* allow 20secs for mount/unmount for now - revisit */
  1202				if (signal_pending(current) ||
  1203						(schedule_timeout(20*HZ) == 0)) {
  1204					kfree(work);
  1205					return nfserr_eagain;
  1206				}
  1207				finish_wait(&nn->nfsd_ssc_waitq, &wait);
  1208				goto try_again;
  1209			}
  1210			*ss_mnt = ni->nsui_vfsmount;
  1211			refcount_inc(&ni->nsui_refcnt);
  1212			spin_unlock(&nn->nfsd_ssc_lock);
  1213			kfree(work);
  1214	
  1215			/* return vfsmount in ss_mnt */
  1216			return 0;
  1217		}
  1218		if (work) {
> 1219			strncpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr));
  1220			refcount_set(&work->nsui_refcnt, 2);
  1221			work->nsui_busy = true;
  1222			list_add_tail(&work->nsui_list, &nn->nfsd_ssc_mount_list);
  1223			*retwork = work;
  1224		}
  1225		spin_unlock(&nn->nfsd_ssc_lock);
  1226		return 0;
  1227	}
  1228	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size
@ 2022-04-22 22:10 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-04-22 22:10 UTC (permalink / raw)
  To: Dai Ngo; +Cc: kbuild-all, linux-kernel, J. Bruce Fields

Hi Dai,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   281b9d9a4b02229b602a14f7540206b0fbe4134f
commit: f4e44b393389c77958f7c58bf4415032b4cda15b NFSD: delay unmount source's export after inter-server copy completed.
date:   11 months ago
config: openrisc-allmodconfig (https://download.01.org/0day-ci/archive/20220423/202204230647.SqpJiwKQ-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4e44b393389c77958f7c58bf4415032b4cda15b
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout f4e44b393389c77958f7c58bf4415032b4cda15b
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross W=1 O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/usb/renesas_usbhs/ fs/nfsd/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   fs/nfsd/nfs4proc.c: In function 'nfsd4_ssc_setup_dul.constprop':
>> fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size [-Wstringop-truncation]
    1219 |                 strncpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr));
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +1219 fs/nfsd/nfs4proc.c

  1174	
  1175	/*
  1176	 * setup a work entry in the ssc delayed unmount list.
  1177	 */
  1178	static int nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
  1179			struct nfsd4_ssc_umount_item **retwork, struct vfsmount **ss_mnt)
  1180	{
  1181		struct nfsd4_ssc_umount_item *ni = 0;
  1182		struct nfsd4_ssc_umount_item *work = NULL;
  1183		struct nfsd4_ssc_umount_item *tmp;
  1184		DEFINE_WAIT(wait);
  1185	
  1186		*ss_mnt = NULL;
  1187		*retwork = NULL;
  1188		work = kzalloc(sizeof(*work), GFP_KERNEL);
  1189	try_again:
  1190		spin_lock(&nn->nfsd_ssc_lock);
  1191		list_for_each_entry_safe(ni, tmp, &nn->nfsd_ssc_mount_list, nsui_list) {
  1192			if (strncmp(ni->nsui_ipaddr, ipaddr, sizeof(ni->nsui_ipaddr)))
  1193				continue;
  1194			/* found a match */
  1195			if (ni->nsui_busy) {
  1196				/*  wait - and try again */
  1197				prepare_to_wait(&nn->nfsd_ssc_waitq, &wait,
  1198					TASK_INTERRUPTIBLE);
  1199				spin_unlock(&nn->nfsd_ssc_lock);
  1200	
  1201				/* allow 20secs for mount/unmount for now - revisit */
  1202				if (signal_pending(current) ||
  1203						(schedule_timeout(20*HZ) == 0)) {
  1204					kfree(work);
  1205					return nfserr_eagain;
  1206				}
  1207				finish_wait(&nn->nfsd_ssc_waitq, &wait);
  1208				goto try_again;
  1209			}
  1210			*ss_mnt = ni->nsui_vfsmount;
  1211			refcount_inc(&ni->nsui_refcnt);
  1212			spin_unlock(&nn->nfsd_ssc_lock);
  1213			kfree(work);
  1214	
  1215			/* return vfsmount in ss_mnt */
  1216			return 0;
  1217		}
  1218		if (work) {
> 1219			strncpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr));
  1220			refcount_set(&work->nsui_refcnt, 2);
  1221			work->nsui_busy = true;
  1222			list_add_tail(&work->nsui_list, &nn->nfsd_ssc_mount_list);
  1223			*retwork = work;
  1224		}
  1225		spin_unlock(&nn->nfsd_ssc_lock);
  1226		return 0;
  1227	}
  1228	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 5+ messages in thread

* fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size
@ 2022-01-01 19:51 ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-01-01 19:51 UTC (permalink / raw)
  To: Dai Ngo; +Cc: kbuild-all, linux-kernel, J. Bruce Fields

Hi Dai,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8008293888188c3923f5bd8a69370dae25ed14e5
commit: f4e44b393389c77958f7c58bf4415032b4cda15b NFSD: delay unmount source's export after inter-server copy completed.
date:   7 months ago
config: openrisc-allyesconfig (https://download.01.org/0day-ci/archive/20220102/202201020346.aY1Or5Ed-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4e44b393389c77958f7c58bf4415032b4cda15b
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout f4e44b393389c77958f7c58bf4415032b4cda15b
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=openrisc SHELL=/bin/bash fs/nfsd/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   fs/nfsd/nfs4proc.c: In function 'nfsd4_ssc_setup_dul.constprop':
>> fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size [-Wstringop-truncation]
    1219 |                 strncpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr));
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +1219 fs/nfsd/nfs4proc.c

  1174	
  1175	/*
  1176	 * setup a work entry in the ssc delayed unmount list.
  1177	 */
  1178	static int nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
  1179			struct nfsd4_ssc_umount_item **retwork, struct vfsmount **ss_mnt)
  1180	{
  1181		struct nfsd4_ssc_umount_item *ni = 0;
  1182		struct nfsd4_ssc_umount_item *work = NULL;
  1183		struct nfsd4_ssc_umount_item *tmp;
  1184		DEFINE_WAIT(wait);
  1185	
  1186		*ss_mnt = NULL;
  1187		*retwork = NULL;
  1188		work = kzalloc(sizeof(*work), GFP_KERNEL);
  1189	try_again:
  1190		spin_lock(&nn->nfsd_ssc_lock);
  1191		list_for_each_entry_safe(ni, tmp, &nn->nfsd_ssc_mount_list, nsui_list) {
  1192			if (strncmp(ni->nsui_ipaddr, ipaddr, sizeof(ni->nsui_ipaddr)))
  1193				continue;
  1194			/* found a match */
  1195			if (ni->nsui_busy) {
  1196				/*  wait - and try again */
  1197				prepare_to_wait(&nn->nfsd_ssc_waitq, &wait,
  1198					TASK_INTERRUPTIBLE);
  1199				spin_unlock(&nn->nfsd_ssc_lock);
  1200	
  1201				/* allow 20secs for mount/unmount for now - revisit */
  1202				if (signal_pending(current) ||
  1203						(schedule_timeout(20*HZ) == 0)) {
  1204					kfree(work);
  1205					return nfserr_eagain;
  1206				}
  1207				finish_wait(&nn->nfsd_ssc_waitq, &wait);
  1208				goto try_again;
  1209			}
  1210			*ss_mnt = ni->nsui_vfsmount;
  1211			refcount_inc(&ni->nsui_refcnt);
  1212			spin_unlock(&nn->nfsd_ssc_lock);
  1213			kfree(work);
  1214	
  1215			/* return vfsmount in ss_mnt */
  1216			return 0;
  1217		}
  1218		if (work) {
> 1219			strncpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr));
  1220			refcount_set(&work->nsui_refcnt, 2);
  1221			work->nsui_busy = true;
  1222			list_add_tail(&work->nsui_list, &nn->nfsd_ssc_mount_list);
  1223			*retwork = work;
  1224		}
  1225		spin_unlock(&nn->nfsd_ssc_lock);
  1226		return 0;
  1227	}
  1228	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size
@ 2022-01-01 19:51 ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-01-01 19:51 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3816 bytes --]

Hi Dai,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8008293888188c3923f5bd8a69370dae25ed14e5
commit: f4e44b393389c77958f7c58bf4415032b4cda15b NFSD: delay unmount source's export after inter-server copy completed.
date:   7 months ago
config: openrisc-allyesconfig (https://download.01.org/0day-ci/archive/20220102/202201020346.aY1Or5Ed-lkp(a)intel.com/config)
compiler: or1k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4e44b393389c77958f7c58bf4415032b4cda15b
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout f4e44b393389c77958f7c58bf4415032b4cda15b
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=openrisc SHELL=/bin/bash fs/nfsd/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   fs/nfsd/nfs4proc.c: In function 'nfsd4_ssc_setup_dul.constprop':
>> fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size [-Wstringop-truncation]
    1219 |                 strncpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr));
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +1219 fs/nfsd/nfs4proc.c

  1174	
  1175	/*
  1176	 * setup a work entry in the ssc delayed unmount list.
  1177	 */
  1178	static int nfsd4_ssc_setup_dul(struct nfsd_net *nn, char *ipaddr,
  1179			struct nfsd4_ssc_umount_item **retwork, struct vfsmount **ss_mnt)
  1180	{
  1181		struct nfsd4_ssc_umount_item *ni = 0;
  1182		struct nfsd4_ssc_umount_item *work = NULL;
  1183		struct nfsd4_ssc_umount_item *tmp;
  1184		DEFINE_WAIT(wait);
  1185	
  1186		*ss_mnt = NULL;
  1187		*retwork = NULL;
  1188		work = kzalloc(sizeof(*work), GFP_KERNEL);
  1189	try_again:
  1190		spin_lock(&nn->nfsd_ssc_lock);
  1191		list_for_each_entry_safe(ni, tmp, &nn->nfsd_ssc_mount_list, nsui_list) {
  1192			if (strncmp(ni->nsui_ipaddr, ipaddr, sizeof(ni->nsui_ipaddr)))
  1193				continue;
  1194			/* found a match */
  1195			if (ni->nsui_busy) {
  1196				/*  wait - and try again */
  1197				prepare_to_wait(&nn->nfsd_ssc_waitq, &wait,
  1198					TASK_INTERRUPTIBLE);
  1199				spin_unlock(&nn->nfsd_ssc_lock);
  1200	
  1201				/* allow 20secs for mount/unmount for now - revisit */
  1202				if (signal_pending(current) ||
  1203						(schedule_timeout(20*HZ) == 0)) {
  1204					kfree(work);
  1205					return nfserr_eagain;
  1206				}
  1207				finish_wait(&nn->nfsd_ssc_waitq, &wait);
  1208				goto try_again;
  1209			}
  1210			*ss_mnt = ni->nsui_vfsmount;
  1211			refcount_inc(&ni->nsui_refcnt);
  1212			spin_unlock(&nn->nfsd_ssc_lock);
  1213			kfree(work);
  1214	
  1215			/* return vfsmount in ss_mnt */
  1216			return 0;
  1217		}
  1218		if (work) {
> 1219			strncpy(work->nsui_ipaddr, ipaddr, sizeof(work->nsui_ipaddr));
  1220			refcount_set(&work->nsui_refcnt, 2);
  1221			work->nsui_busy = true;
  1222			list_add_tail(&work->nsui_list, &nn->nfsd_ssc_mount_list);
  1223			*retwork = work;
  1224		}
  1225		spin_unlock(&nn->nfsd_ssc_lock);
  1226		return 0;
  1227	}
  1228	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-22 22:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 11:13 fs/nfsd/nfs4proc.c:1219:17: warning: 'strncpy' specified bound 63 equals destination size kernel test robot
2022-01-18 11:13 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-04-22 22:10 kernel test robot
2022-01-01 19:51 kernel test robot
2022-01-01 19:51 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.