Below upstream patch fixes the problem: master patch: http://review.gluster.org/#/c/9106/ release-3.7 patch: http://review.gluster.org/#/c/13655
This is fixed in 3.8 "http://review.gluster.org/#/c/9106/". For now we will not be back-porting to 3.1.3, as we may hit issues with ctime change and tar application