gluster / glusterfs

Gluster Filesystem : Build your distributed storage in minutes
https://www.gluster.org
GNU General Public License v2.0
4.53k stars 1.07k forks source link

Possible no unlock. #4351

Open Bbulatov opened 2 weeks ago

Bbulatov commented 2 weeks ago

Good day! During the statistical analysis, a situation was found where the lock remained open. Testing was carried out on Linux Debian 11. A LOCK(&cache->gc_lock) is created in the file src/gidcache.c:69. But if you get to line 96, having satisfied all the conditions, it turns out that UNLOCK(&cache->gc_lock) will not be called in any way. Please clarify whether this is critical and whether changes will be made to the code?

mohit84 commented 2 weeks ago

Good day! During the statistical analysis, a situation was found where the lock remained open. Testing was carried out on Linux Debian 11. A LOCK(&cache->gc_lock) is created in the file src/gidcache.c:69. But if you get to line 96, having satisfied all the conditions, it turns out that UNLOCK(&cache->gc_lock) will not be called in any way. Please clarify whether this is critical and whether changes will be made to the code?

In that case UNLOCK Is call by parent function on the basis of code return by the function gid_cache_lookup.