Whamcloud - gitweb
LU-10806 target: skip discard for a missing obt_lut 40/33240/2
authorAlexander Boyko <c17825@cray.com>
Wed, 26 Sep 2018 12:45:20 +0000 (08:45 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 5 Oct 2018 22:26:05 +0000 (22:26 +0000)
commit5ed65fd0594741e69999216db27d85f7f6f7f5d6
tree5252a7d56e8a17804f0eeaad8c63c2e62bb48ca1
parente2a8cd070cb0ffb5b7bb89ce284e4cb41b99f7ef
LU-10806 target: skip discard for a missing obt_lut

If error happens at tgt_init, obt_lut is zeroed. The error handle
path destroys export and calls tgt_grant_discard which access to
non allocated memory.

The patch skips release grant for zero obt_lut.

BUG: unable to handle kernel NULL pointer dereference at
0000000000000378
IP: [<ffffffff816b6b5c>] _raw_spin_lock+0xc/0x30
[<ffffffffc0ff7c15>] ? tgt_grant_discard+0x35/0x190 [ptlrpc]
[<ffffffffc0fcbe2e>] ? tgt_client_free+0x17e/0x3b0 [ptlrpc]
[<ffffffffc1414097>] mdt_destroy_export+0x87/0x200 [mdt]

Signed-off-by: Alexander Boyko <c17825@cray.com>
Cray-bug-id: LUS-6260
Change-Id: Iccd80cb753122727156430e2593340c32841451c
Reviewed-on: https://review.whamcloud.com/33240
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/target/tgt_grant.c