Bug 1665880 - After the shard feature is enabled, the glfs_read will always return the length of the read buffer, no the actual length readed
Summary: After the shard feature is enabled, the glfs_read will always return the leng...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: sharding
Version: mainline
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Xiubo Li
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-14 10:43 UTC by Xiubo Li
Modified: 2019-08-12 15:59 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-12 15:59:38 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gluster.org Gerrit 22022 0 None Abandoned feature/shard: fix the return length of shard_readv 2019-06-23 19:30:33 UTC

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!


Note You need to log in before you can comment on or make changes to this bug.