Whamcloud - gitweb
LU-9753 ofd: 64-bits diff variable to avoid overflow 75/27975/2
authorFan Yong <fan.yong@intel.com>
Fri, 7 Jul 2017 15:24:14 +0000 (23:24 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Jul 2017 03:29:12 +0000 (03:29 +0000)
commit03bbd4c27471751ada57282fad15e074ae01e9d7
tree6bf50b1962b6010cbcc7b490ca3ea7d62bcfa272
parentc668a8d405a9d8819bf9b96e0c610ccc5353d77d
LU-9753 ofd: 64-bits diff variable to avoid overflow

In ofd_create_hdl(), the logic will compare the OST stroed LAST_ID
with the MDT given one: if the difference exceeds some threshold,
then it will trust the OST LAST_ID directly and reset the MDT side
value with the OST one. Otherwise, the orphan OST-objects will be
destroyed.

Unfortunately, both the OST stored LAST_ID and MDT given one are
64 bits, but the @diff variable is only 32 bits, and if the OST
side value is too larger than the MDT side, then the @diff will
overflow. That will misguide the OST to destroy useful OST-objects
by wrong. This patch change the @diff as 64 bits variable.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: If75899cbab5754be4ede226e0463ba5f69d70e3d
Reviewed-on: https://review.whamcloud.com/27975
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lu_target.h
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_obd.c
lustre/target/tgt_grant.c