New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: avoid returning negative space available #15481

Merged
merged 1 commit into from Jun 19, 2017

Conversation

Projects
None yet
3 participants
@jcsp
Contributor

jcsp commented Jun 5, 2017

...when a quota is set and the used bytes exceed
the quota.

Fixes: http://tracker.ceph.com/issues/20178
Signed-off-by: John Spray john.spray@redhat.com

@jcsp jcsp requested a review from batrick Jun 5, 2017

const fsblkcnt_t free = total - used;
// It is possible for a quota to be exceeded: arithmetic here must
// handle case where used > total.
const fsblkcnt_t free = MAX(0, total - used);

This comment has been minimized.

@tchaikov

tchaikov Jun 5, 2017

Contributor

if fsblkcnt_t is an unsigned type, we might need to cast it to a signed type first.

This comment has been minimized.

@jcsp

jcsp Jun 5, 2017

Contributor

Good point, amended to do it another way

John Spray
client: avoid returning negative space available
...when a quota is set and the used bytes exceed
the quota.

Fixes: http://tracker.ceph.com/issues/20178
Signed-off-by: John Spray <john.spray@redhat.com>
@batrick

batrick approved these changes Jun 5, 2017

@batrick

This comment has been minimized.

Member

batrick commented Jun 5, 2017

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>

@jcsp jcsp merged commit 35fcb15 into ceph:master Jun 19, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@jcsp jcsp deleted the jcsp:wip-20178 branch Jun 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment