Whamcloud - gitweb
LU-9753 ofd: 64-bits diff variable to avoid overflow 30/28230/2
authorFan Yong <fan.yong@intel.com>
Fri, 7 Jul 2017 15:24:14 +0000 (23:24 +0800)
committerJohn L. Hammond <john.hammond@intel.com>
Mon, 7 Aug 2017 18:49:54 +0000 (18:49 +0000)
commit9903e1efd9bb1ddf0d74513c5036169d4a651bfe
treea01d8632a99fd4692bb6c674198dc1035bea1a77
parent138c9a3bae52a2d6abeb5af07fc2076bcd9526b1
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.

Lustre-change: https://review.whamcloud.com/27975
Lustre-commit: 03bbd4c27471751ada57282fad15e074ae01e9d7

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: If75899cbab5754be4ede226e0463ba5f69d70e3d
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/28230
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/include/lu_target.h
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_obd.c
lustre/target/tgt_grant.c