Description of problem: When I was testing the gluster-block/tcmu-runner with the glsuterfs mainline code, there will be a crash in gluster-block: # journalctl -r [...] 16878 Jan 14 17:42:16 rhel3 kernel: gluster-blockd[5209]: segfault at 0 ip 00007fc430c0ff81 sp 00007fc42bffc608 error 4 in libc-2.17.so[7fc430aa1000+1c3000] 16879 Jan 14 17:42:16 rhel3 systemd: gluster-blockd.service: main process exited, code=killed, status=11/SEGV 16880 Jan 14 17:42:16 rhel3 systemd: Unit gluster-blockd.service entered failed state. 16881 Jan 14 17:42:16 rhel3 systemd: gluster-blockd.service failed. [...] This is because when reading and parsing the meta-data file and after EOF the loop won't stop and keep reading and glfs_read returns none zero. Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: 1. Create one volume and enable the features.shard 2. Try to allocate one buffer large enough and make sure the buffer size is larger than the actual file size. 3. len = glfs_read (gfd, buffer, sizeof(buffer)). Actual results: len will always equal to sizeof(buffer) Expected results: len < sizeof(buffer) Additional info:
REVIEW: https://review.gluster.org/22022 (feature/shard: fix the return length of shard_readv) posted (#1) for review on master by Xiubo Li
Hi Xiubo, There's a similar bug raised by ovirt team for which I sent a patch at https://review.gluster.org/c/glusterfs/+/23175 to fix it. Could you check if this patch fixes the issue seen in gluster-block as well? -Krutika
(In reply to Krutika Dhananjay from comment #2) > Hi Xiubo, > > There's a similar bug raised by ovirt team for which I sent a patch at > https://review.gluster.org/c/glusterfs/+/23175 to fix it. > Could you check if this patch fixes the issue seen in gluster-block as well? > @Krutika Tested it, I couldn't reproduce it any more with this. Thanks BRs
Patch at https://review.gluster.org/c/glusterfs/+/23175 fixes this issue. I'm therefore closing this bz with the resolution NEXT_RELEASE. Thanks a lot Xiubo Li, for taking the time to test the fix!