Bug 1510940

Summary: The number of bytes of the quota specified in version 3.7 or later is incorrect
Product: [Community] GlusterFS Reporter: Sanoj Unnikrishnan <sunnikri>
Component: quotaAssignee: Sanoj Unnikrishnan <sunnikri>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: mainlineCC: bugs, jstrunk, piinapier, sunnikri
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-4.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1489043
: 1511766 (view as bug list) Environment:
Last Closed: 2018-03-15 11:20:03 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:
Bug Depends On:    
Bug Blocks: 1489043, 1504174, 1511766    

Description Sanoj Unnikrishnan 2017-11-08 13:11:18 UTC
+++ This bug was initially created as a clone of Bug #1489043 +++

Description of problem:
The number of bytes specified in version 3.7 or later is incorrect. Therefore, only 7711 quota settings can be registered.


How reproducible:
When 7711 or more quotas are registered, the following error occurs.

"quota.conf corrupted"


Additional info:

glusterfs/xlators/mgmt/glusterd/src/glusterd-quota.c
Line 927

while ((bytes_read = sys_read (src_fd, (void *)&buf, entry_sz)) > 0) {
    if (bytes_read % 16 != 0) {

Comment 1 Worker Ant 2017-11-08 13:14:28 UTC
REVIEW: https://review.gluster.org/18695 (quota: fixes issue in quota.conf when setting large number of limits) posted (#3) for review on master by sanoj-unnikrishnan

Comment 2 Worker Ant 2017-11-09 21:15:34 UTC
COMMIT: https://review.gluster.org/18695 committed in master by  

------------- quota: fixes issue in quota.conf when setting large number of limits

Problem: It was not possible to configure more than 7712 quota limits.
This was because a stack buffer of size 131072 was used to read from
quota.conf file. In the new format of quota.conf file each gfid entry
takes 17bytes (16byte gfid + 1 byte type). So, the buf_size was not a
multiple of gfid entry size and as per code this was considered as
corruption.

Solution: make buf size multiple of gfid entry size

Change-Id: Id036225505a47a4f6fa515a572ee7b0c958f30ed
BUG: 1510940
Signed-off-by: Sanoj Unnikrishnan <sunnikri>

Comment 3 Sanoj Unnikrishnan 2018-03-08 09:01:02 UTC
*** Bug 1504174 has been marked as a duplicate of this bug. ***

Comment 4 Shyamsundar 2018-03-15 11:20:03 UTC
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-4.0.0, please open a new bug report.

glusterfs-4.0.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/announce/2018-March/000092.html
[2] https://www.gluster.org/pipermail/gluster-users/