Patch by: Tang Meng Review by: alg(cherry picked from commit e5720990bd3691222363bb2d674b7d39a0d8829f)