Actions
Bug #67169
closed
DP
NS
common/strtol: fix `strict_iec_cast` which parses inputs like `TG` or `GT`
Bug #67169:
common/strtol: fix `strict_iec_cast` which parses inputs like `TG` or `GT`
Status:
Resolved
Priority:
Normal
Assignee:
Category:
Correctness/Safety
Target version:
Due date:
% Done:
0%
Source:
Q/A
Backport:
quincy,reef,squid
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Labels (FS):
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
v19.3.0-5756-gadc6f2dbb5
Released In:
v20.2.0~1728
Upkeep Timestamp:
2026-08-28T01:41:18+00:00
Description
This came up from QA team,
$ setfattr -n ceph.quota.max_bytes -v 1TG /mnt/ceph-fuse/test_quota/
$ setfattr -n ceph.quota.max_bytes -v 1GT /mnt/ceph-fuse/test_quota/
$ setfattr -n ceph.quota.max_bytes -v KT /mnt/ceph-fuse/test_quota/
$ getfattr -n ceph.quota.max_bytes /mnt/ceph-fuse/test_quota/
getfattr: Removing leading '/' from absolute path names
file: mnt/ceph-fuse/test_quota/ ceph.quota.max_bytes="1024"
The function strict_iec_cast() is implemented in such a way that it only checks for first char i.e. when you apply TG it considers it as Ti, GT as Gi and KT as Ki. This looks to be a corner case but the issue is this is the common code (from ceph/src/common/strtol.cc) i.e. this function is used across ceph and and not only limited to CephFS. Currently used at:
./mds/Server.cc:5971: int64_t q = strict_iec_cast<int64_t>(value, &cast_err);
./mon/OSDMonitor.cc:8320: n = strict_iec_cast<int64_t>(val, &interr);
./rgw/rgw_admin.cc:3745: max_size = strict_iec_cast<long long>(val, &err);
Also add testcases in src/test/strtol.cc
DP Updated by Dhairya Parmar over 2 years ago
- Subject changed from common/strtol: fix `strict_iec_cast` which parses inputs like `TG` or `GT` to common/strtol: fix @strict_iec_cast@ which parses inputs like @TG@ or @GT@
DP Updated by Dhairya Parmar over 2 years ago
- Subject changed from common/strtol: fix @strict_iec_cast@ which parses inputs like @TG@ or @GT@ to common/strtol: fix `strict_iec_cast` which parses inputs like `TG` or `GT`
DP Updated by Dhairya Parmar over 2 years ago
- Description updated (diff)
VS Updated by Venky Shankar over 2 years ago
- Assignee set to Dhairya Parmar
- Target version set to v20.0.0
- Backport set to quincy,reef,pacific
PD Updated by Patrick Donnelly over 2 years ago
- Has duplicate Bug #67226: ceph.quota.max_bytes accepting Invalid values added
PD Updated by Patrick Donnelly over 2 years ago
- Status changed from New to Fix Under Review
- Assignee changed from Dhairya Parmar to Neeraj Pratap Singh
- Pull request ID set to 58898
KS Updated by Konstantin Shalygin over 2 years ago
- Backport changed from quincy,reef,pacific to quincy,reef
RD Updated by Rishabh Dave about 2 years ago
- Status changed from Fix Under Review to Pending Backport
- Backport changed from quincy,reef to quincy,reef,squid
UB Updated by Upkeep Bot about 2 years ago
- Copied to Backport #68708: squid: common/strtol: fix `strict_iec_cast` which parses inputs like `TG` or `GT` added
UB Updated by Upkeep Bot about 2 years ago
- Copied to Backport #68709: reef: common/strtol: fix `strict_iec_cast` which parses inputs like `TG` or `GT` added
UB Updated by Upkeep Bot about 2 years ago
- Copied to Backport #68710: quincy: common/strtol: fix `strict_iec_cast` which parses inputs like `TG` or `GT` added
UB Updated by Upkeep Bot about 2 years ago
- Tags (freeform) set to backport_processed
UB Updated by Upkeep Bot over 1 year ago
- Merge Commit set to adc6f2dbb507f13e473ab8b5551dedcc56791124
- Fixed In set to v19.3.0-5756-gadc6f2dbb50
- Upkeep Timestamp set to 2025-07-08T22:37:51+00:00
UB Updated by Upkeep Bot over 1 year ago
- Fixed In changed from v19.3.0-5756-gadc6f2dbb50 to v19.3.0-5756-gadc6f2dbb507
- Upkeep Timestamp changed from 2025-07-08T22:37:51+00:00 to 2025-07-14T15:46:24+00:00
UB Updated by Upkeep Bot over 1 year ago
- Fixed In changed from v19.3.0-5756-gadc6f2dbb507 to v19.3.0-5756-gadc6f2dbb5
- Upkeep Timestamp changed from 2025-07-14T15:46:24+00:00 to 2025-07-14T21:10:32+00:00
UB Updated by Upkeep Bot about 1 year ago
- Released In set to v20.2.0~1728
- Upkeep Timestamp changed from 2025-07-14T21:10:32+00:00 to 2025-11-01T01:03:02+00:00
UB Updated by Upkeep Bot 8 months ago
- Status changed from Pending Backport to Resolved
- Upkeep Timestamp changed from 2025-11-01T01:03:02+00:00 to 2026-03-24T01:13:37+00:00
UB Updated by Upkeep Bot 3 months ago
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-03-24T01:13:37+00:00 to 2026-08-28T01:41:18+00:00
Actions