Merged revisions 5820-5821,5827,5829 via svnmerge from

svn+ssh://yanb123@svn.code.sf.net/p/scst/svn/trunk

........
  r5820 | bvassche | 2014-09-30 13:07:38 +0200 (Tue, 30 Sep 2014) | 4 lines
  
  scst_local: Restore support for detecting LUN 16383 via a sequential scan
  
  Reported-by: Sebastian Herbszt <herbszt@gmx.de>
........
  r5821 | vlnb | 2014-10-02 05:19:10 +0200 (Thu, 02 Oct 2014) | 3 lines
  
  Small doc improvements
........
  r5827 | bvassche | 2014-10-03 14:23:34 +0200 (Fri, 03 Oct 2014) | 1 line
  
  scripts/generate-kernel-patch: Only generate scst_itf_ver.h if needed
........
  r5829 | bvassche | 2014-10-03 14:26:14 +0200 (Fri, 03 Oct 2014) | 20 lines
  
  scst_mem: Fix a memory leak triggered by the scst_user driver
  
  Avoid that the following memory leak can occur:
  - sgv_pool_alloc() is called with SGV_POOL_RETURN_OBJ_ON_ALLOC_FAIL
    set, with neither SGV_POOL_NO_ALLOC_ON_CACHE_MISS nor
    SGV_POOL_ALLOC_NO_CACHED set and with 'size' such that
    sgv_max_local_pages < pages_to_alloc <= pool->max_cached_pages.
  - sgv_get_obj() and sgv_alloc_arrays() succeed.
  - sgv_alloc_sg_entries() fails.
  - sgv_get_obj() returns the SGV object with no buffers.
  - A call to sgv_pool_free() adds this object to the recycle list.
  - sgv_pool_alloc() is called a second time with the same parameters.
  - sgv_get_obj() retrieves the object that was previously added to
    the recycle list.
  - sgv_alloc_arrays() is called and overwrites the obj->sg_entries
    pointer although it still points at allocated memory, resulting
    in a memory leak.
  
  Reported-by: Shahar Salzman <shahar.salzman@kaminario.com>
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5832 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Yan Burman
2014-10-05 06:12:59 +00:00
parent f704a4afee
commit 69104309ac
4 changed files with 12 additions and 6 deletions
+2 -3
View File
@@ -49,9 +49,8 @@ qla2x00t_git
qla2x00t_git subdirectory
Thats all. Now "make all" and other common and QLA specific root
Makefile targets "magically" start working. The bind mount is necessary
for the driver to correctly find the SCST header files. Symlinks can't
do it.
Makefile targets "magically" start working. For detail instructions how
to setup QLA target build environment see its README or HOWTO.
You can still build the old driver using qla_old* root Makefile targets.
+2 -1
View File
@@ -385,7 +385,8 @@ do
add_file "${f}" "drivers/scst/${f#scst/src/}"
fi
done
if [ "$s" = "scst_03_public_headers" ]; then
if grep -q /scst_itf_ver.h scst/src/Makefile &&
[ "$s" = "scst_03_public_headers" ]; then
tmp_itf_ver="$(mktemp /tmp/scst-itf-ver.h.XXXXXXXXXX)"
cat <<"EOF" >$tmp_itf_ver
/* Autogenerated, don't edit */
+7 -1
View File
@@ -1021,7 +1021,13 @@ struct scatterlist *sgv_pool_alloc(struct sgv_pool *pool, unsigned int size,
goto out_fail_free;
}
TRACE_MEM("Brand new obj %p", obj);
if (likely(!obj->recycling_list_entry.next)) {
TRACE_MEM("Brand new obj %p", obj);
} else if (unlikely(obj->sg_entries != obj->sg_entries_data)) {
TRACE_MEM("Cached obj %p with sg_count == 0", obj);
kfree(obj->sg_entries);
obj->sg_entries = NULL;
}
if (pages_to_alloc <= sgv_max_local_pages) {
obj->sg_entries = obj->sg_entries_data;
+1 -1
View File
@@ -1678,7 +1678,7 @@ static int scst_local_driver_probe(struct device *dev)
sess->shost = hpnt;
hpnt->max_id = 1; /* Don't want more than one id */
hpnt->max_lun = SCST_MAX_LUN;
hpnt->max_lun = SCST_MAX_LUN + 1;
/*
* Because of a change in the size of this field at 2.6.26