Whamcloud - gitweb
LU-7988 hsm: Fix possible out of bounds reference in message 79/19579/14
authorFrank Zago <fzago@cray.com>
Mon, 11 Apr 2016 19:24:02 +0000 (15:24 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 11 Aug 2016 05:50:28 +0000 (05:50 +0000)
commit526ae2f6a383b326da4b7be1623d9fb6563d0d37
tree80efe9cbc2f37c87f96821a4869e7c82bb5c5674
parentf35328e1e312259d917726f9e953cb6b834e60cf
LU-7988 hsm: Fix possible out of bounds reference in message

In the "Cannot allocate memory" error message, request[i].hal_sz could
be out of bound if the value of i was hsd->max_requests, which is
likely. The short fix would have been to use
request[empty_slot].hal_sz. Instead use a local variable for the
current request. This also reduces the size of the code.

Test-Parameters: trivial testlist=sanity-hsm
Signed-off-by: frank zago <fzago@cray.com>
Change-Id: I324087117df284dacea25774ebd9d4ed04794cbc
Reviewed-on: http://review.whamcloud.com/19579
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Vinayak <vinayakswami.hariharmath@seagate.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_coordinator.c