Bug 1534452

Summary: Reading over than the file size on dispersed volume
Product: [Community] GlusterFS Reporter: jenny <ibestpro>
Component: disperseAssignee: bugs <bugs>
Status: CLOSED DUPLICATE QA Contact:
Severity: urgent Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, dwojslaw, vbellur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-20 05:09:15 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 jenny 2018-01-15 09:55:10 UTC
Description of problem:
Reading over than the file size on dispersed volume

Version-Release number of selected component (if applicable):
3.12.1-2

How reproducible:

------------------------------------------------------
Volume Name: TEST_VOL
Type: Disperse
Volume ID: be52b68d-ae83-46e3-9527-0e536b867bcc
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x (6 + 3) = 9
Transport-type: tcp
Bricks:
Brick1: server1:/data/brick1
Brick2: server2:/data/brick1
Brick3: server3:/data/brick1
Brick4: server1:/data/brick2
Brick5: server2:/data/brick2
Brick6: server3:/data/brick2
Brick7: server1:/data/brick3
Brick8: server2:/data/brick3
Brick9: server3:/data/brick3
Options Reconfigured:
network.ping-timeout: 10
performance.write-behind: on
features.quota-deem-statfs: on
features.inode-quota: on
features.quota: on
transport.address-family: inet
nfs.disable: on
------------------------------------------------------

Steps to Reproduce:
1. generating the temporary files like below command.
fallocate -l 130394  test1 
fallocate -l 667417658  test2
fallocate -l 2493251482 test3 

2. reading the files to EOF like below sources
--------------------------------------------------------------
 glfs_fd_t* fd = glfs_open (gluster_fs, "/test1", O_RDWR);

    size_t retr = 0;
    off_t offset = 0;
    unsigned char buf[128*1024] = {0,};

    while ((retr = glfs_pread(fd, buf, sizeof(buf), offset, 0)) > 0) {
        printf("retr : %ld, offset : %ld(%d) \n", retr, offset, errno);
        offset += retr;
    }

    printf("offset : %d\n", offset);
-----------------------------------------------------------------------------------------------------------------

Actual results:
print debug 

retr : 130394, offset : 42(0)
retr : 1024, offset : 130436(0)
retr : 636, offset : 131460(0)
offset : 132096(0)

Expected results:
The reading size (total offset) has to be the same with original file size
offset : 130394

Additional info:

Why the glfs_pread(or glfs_read) function reads until over than the file size ?

This is fine on dispersed (4+2) and (8+1) volume but it is occurred on (6+3) or (6+4) or (7+2) disperse volume.
I want to know exact cause.
Thank you.

Comment 1 Shyamsundar 2018-10-23 14:55:18 UTC
Release 3.12 has been EOLd and this bug was still found to be in the NEW state, hence moving the version to mainline, to triage the same and take appropriate actions.

Comment 2 Vijay Bellur 2018-11-20 05:09:15 UTC

*** This bug has been marked as a duplicate of bug 1534453 ***