Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1665880

Summary: After the shard feature is enabled, the glfs_read will always return the length of the read buffer, no the actual length readed
Product: [Community] GlusterFS Reporter: Xiubo Li <xiubli>
Component: shardingAssignee: Xiubo Li <xiubli>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: atumball, bugs, kdhananj
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-12 15:59:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Xiubo Li 2019-01-14 10:43:42 UTC
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:

Comment 1 Worker Ant 2019-01-14 10:51:04 UTC
REVIEW: https://review.gluster.org/22022 (feature/shard: fix the return length of shard_readv) posted (#1) for review on master by Xiubo Li

Comment 2 Krutika Dhananjay 2019-08-08 06:00:55 UTC
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

Comment 3 Xiubo Li 2019-08-09 06:50:59 UTC
(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

Comment 4 Krutika Dhananjay 2019-08-12 15:59:38 UTC
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!