Description of problem:
afr_open() stores fd reference in local->cont.open structure. But in the callback function "afr_open_ftruncate_cbk" ( when openflags contain 'O_TRUNC' set), we reference local->fd in AFR_STACK_UNWIND resulting in error or crash.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Patch posted for review - https://review.gluster.org/#/c/glusterfs/+/21617/
REVIEW: https://review.gluster.org/21617 (afr: open_ftruncate_cbk should read fd from local->cont.open struct) posted (#2) for review on master by soumya k
REVIEW: https://review.gluster.org/21617 (afr: open_ftruncate_cbk should read fd from local->cont.open struct) posted (#8) for review on master by Ravishankar N
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-6.0, please open a new bug report.
glusterfs-6.0 has been announced on the Gluster mailinglists , packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist  and the update infrastructure for your distribution.