[linux-next:master 2674/3921] mm/vmalloc.c:1079:3-9: preceding lock on line 1075 (fwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please check whether an unlock is needed before the return on line 1079.

julia

---------- Forwarded message ----------
Date: Fri, 5 Apr 2024 04:15:36 +0800
From: kernel test robot <lkp@xxxxxxxxx>
To: oe-kbuild@xxxxxxxxxxxxxxx
Cc: lkp@xxxxxxxxx, Julia Lawall <julia.lawall@xxxxxxxx>
Subject: [linux-next:master 2674/3921] mm/vmalloc.c:1079:3-9: preceding lock on
    line 1075

BCC: lkp@xxxxxxxxx
CC: oe-kbuild-all@xxxxxxxxxxxxxxx
CC: Linux Memory Management List <linux-mm@xxxxxxxxx>
TO: "Uladzislau Rezki (Sony)" <urezki@xxxxxxxxx>
CC: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
CC: Linux Memory Management List <linux-mm@xxxxxxxxx>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2b3d5988ae2cb5cd945ddbc653f0a71706231fdd
commit: 936eedaeacdee6663fa552fc650df4cd4d75d3e4 [2674/3921] mm: vmalloc: fix lockdep warning
:::::: branch date: 17 hours ago
:::::: commit date: 3 days ago
config: x86_64-randconfig-104-20240405 (https://download.01.org/0day-ci/archive/20240405/202404050445.yVFqmYIK-lkp@xxxxxxxxx/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Julia Lawall <julia.lawall@xxxxxxxx>
| Closes: https://lore.kernel.org/r/202404050445.yVFqmYIK-lkp@xxxxxxxxx/

cocci warnings: (new ones prefixed by >>)
>> mm/vmalloc.c:1079:3-9: preceding lock on line 1075

vim +1079 mm/vmalloc.c

f181234a5a21fd Chen Wandun             2021-09-02  1038
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1039) /*
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1040)  * Returns a node where a first VA, that satisfies addr < va_end, resides.
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1041)  * If success, a node is locked. A user is responsible to unlock it when a
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1042)  * VA is no longer needed to be accessed.
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1043)  *
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1044)  * Returns NULL if nothing found.
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1045)  */
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1046) static struct vmap_node *
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1047) find_vmap_area_exceed_addr_lock(unsigned long addr, struct vmap_area **va)
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1048) {
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1049) 	unsigned long va_start_lowest;
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1050) 	struct vmap_node *vn;
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1051) 	int i;
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1052)
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1053) repeat:
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1054) 	for (i = 0, va_start_lowest = 0; i < nr_vmap_nodes; i++) {
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1055) 		vn = &vmap_nodes[i];
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1056)
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1057) 		spin_lock(&vn->busy.lock);
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1058) 		*va = __find_vmap_area_exceed_addr(addr, &vn->busy.root);
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1059)
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1060) 		if (*va)
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1061) 			if (!va_start_lowest || (*va)->va_start < va_start_lowest)
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1062) 				va_start_lowest = (*va)->va_start;
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1063) 		spin_unlock(&vn->busy.lock);
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1064) 	}
53becf32aec1c8 Uladzislau Rezki (Sony  2024-01-02  1065)
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1066) 	/*
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1067) 	 * Check if found VA exists, it might it is gone away.
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1068) 	 * In this case we repeat the search because a VA has
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1069) 	 * been removed concurrently thus we need to proceed
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1070) 	 * with next one what is a rare case.
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1071) 	 */
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1072) 	if (va_start_lowest) {
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1073) 		vn = addr_to_node(va_start_lowest);
db64fe02258f15 Nicholas Piggin         2008-10-18  1074
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28 @1075) 		spin_lock(&vn->busy.lock);
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1076) 		*va = __find_vmap_area(va_start_lowest, &vn->busy.root);
4aff1dc4fb3a5a Andrey Konovalov        2022-03-24  1077
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1078) 		if (*va)
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28 @1079) 			return vn;
db64fe02258f15 Nicholas Piggin         2008-10-18  1080
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1081) 		spin_unlock(&vn->busy.lock);
936eedaeacdee6 Uladzislau Rezki (Sony  2024-03-28  1082) 		goto repeat;
db64fe02258f15 Nicholas Piggin         2008-10-18  1083  	}
db64fe02258f15 Nicholas Piggin         2008-10-18  1084
db64fe02258f15 Nicholas Piggin         2008-10-18  1085  	return NULL;
db64fe02258f15 Nicholas Piggin         2008-10-18  1086  }
db64fe02258f15 Nicholas Piggin         2008-10-18  1087

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux