Bug 1200670
| Summary: | Convert quota size from n-to-h order before using it | |||
|---|---|---|---|---|
| Product: | [Community] GlusterFS | Reporter: | Krutika Dhananjay <kdhananj> | |
| Component: | replicate | Assignee: | Krutika Dhananjay <kdhananj> | |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | ||
| Severity: | unspecified | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | mainline | CC: | bugs, gluster-bugs | |
| Target Milestone: | --- | Keywords: | Triaged | |
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | glusterfs-3.7.0 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1201622 (view as bug list) | Environment: | ||
| Last Closed: | 2015-05-14 17:29:19 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: | 1201622 | |||
REVIEW: http://review.gluster.org/9853 (cluster/afr: Convert quota size from n/w to host order before use) posted (#1) for review on master by Krutika Dhananjay (kdhananj) REVIEW: http://review.gluster.org/9853 (cluster/afr: Convert quota size from n/w to host order before use) posted (#2) for review on master by Krutika Dhananjay (kdhananj) COMMIT: http://review.gluster.org/9853 committed in master by Pranith Kumar Karampuri (pkarampu) ------ commit 65c68fb75640be2c5744782081250dda886a7b56 Author: Krutika Dhananjay <kdhananj> Date: Tue Mar 10 22:11:57 2015 +0530 cluster/afr: Convert quota size from n/w to host order before use Change-Id: I3e4fe15716556441546fcd62b8ac2833869b21cf BUG: 1200670 Signed-off-by: Krutika Dhananjay <kdhananj> Reviewed-on: http://review.gluster.org/9853 Reviewed-by: Ravishankar N <ravishankar> Reviewed-by: Anuradha Talur <atalur> Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu> Tested-by: Pranith Kumar Karampuri <pkarampu> 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-3.7.0, please open a new bug report. glusterfs-3.7.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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939 [2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user 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-3.7.0, please open a new bug report. glusterfs-3.7.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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939 [2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user 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-3.7.0, please open a new bug report. glusterfs-3.7.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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939 [2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user 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-3.7.0, please open a new bug report. glusterfs-3.7.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://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939 [2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user |
Description of problem: Figured while reading code that AFR is NOT converting quota_size value from network to host byte order before using it in comparisons towards getting the max size. This can cause problems with max_size calculation when the client is running on a little endian machine. 0 afr_handle_quota_size (call_frame_t *frame, xlator_t *this) 1 { 2 unsigned char *readable = NULL; 3 afr_local_t *local = NULL; 4 afr_private_t *priv = NULL; 5 struct afr_reply *replies = NULL; 6 int i = 0; 7 uint64_t size = 0; 8 uint64_t max_size = 0; 9 int readable_cnt = 0; 10 int read_subvol = -1; 11 12 local = frame->local; 13 priv = this->private; 14 replies = local->replies; 15 16 readable = alloca0 (priv->child_count); 17 18 afr_inode_read_subvol_get (local->inode, this, readable, 0, 0); 19 20 readable_cnt = AFR_COUNT (readable, priv->child_count); 21 22 for (i = 0; i < priv->child_count; i++) { 23 if (!replies[i].valid || replies[i].op_ret == -1) 24 continue; 25 if (readable_cnt && !readable[i]) 26 continue; 27 if (!replies[i].xdata) 28 continue; 29 if (dict_get_uint64 (replies[i].xdata, QUOTA_SIZE_KEY, &size)) <---------- here 30 continue; 32 if (read_subvol == -1) 33 read_subvol = i; 34 if (size > max_size) { 35 read_subvol = i; 36 max_size = size; 37 } 38 } 39 40 if (!max_size) 41 return read_subvol; 44 45 for (i = 0; i < priv->child_count; i++) { 46 if (!replies[i].valid || replies[i].op_ret == -1) 47 continue; 48 if (readable_cnt && !readable[i]) 49 continue; 50 if (!replies[i].xdata) 51 continue; 52 if (dict_set_uint64 (replies[i].xdata, QUOTA_SIZE_KEY, max_size)) <------ and here 53 continue; 54 } 55 56 return read_subvol; 57 } Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: