Whamcloud - gitweb
LU-13254 mdt: clear mti_mdt in mdt_thread_info_fini() 92/37592/2
authorMikhail Pershin <mpershin@whamcloud.com>
Sat, 15 Feb 2020 17:09:31 +0000 (20:09 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 05:50:29 +0000 (05:50 +0000)
commit4b3748ae6f8859ee56a142bdf03b8006e888b868
tree8fff4ff254032c89054edc11a221ea0259651248
parent23cdbb827eee6ee298ed2462dccd3abcf1589f37
LU-13254 mdt: clear mti_mdt in mdt_thread_info_fini()

Clear mti_mdt when finalizing mdt_thread_info to prevent
its reuse my other handler later. Usually that may happen
at mdt_lvbo_fill/update() which takes thread info as is,
without initialization because at this point it is not
clear was it already initialized or not. So mti_mdt may be
used there being initialized by some other handler from
different MDT or even with garbage at old pointer.
Meanwhile there is no need to use any mdt_thread_info values
like mti_mdt in mdt_lvbo_fill() because there is MDT device
taken from namespace and the only fields are used from
mdt_thread_info are temporary storage for FID and lu_buffer.

Patch zeros mti_mdt upon thread finalizing and removes also
usages of info->mti_mdt from mdt_lvbo_fill/update() replacing
that with MDT taken from lock namespace.

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: Ib350093f0b70c777932c056b34cb56a9702b650d
Reviewed-on: https://review.whamcloud.com/37592
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_lvb.c