quota checking wrong with project unlimited and user limited

Bug #1872872 reported by zhangqing on 2020-04-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Medium
zhangqing

Bug Description

When creating share, it will check the quota, if the quota is over it will raise error:ShareLimitExceeded.

In One case, when a project's quota set unlimited(-1), and user in the project is limited to a value(>=0).In normal, the user could create share when the user's share not over the user quota. But now,even when the user not over the user's quota they can't create share.

The method _quota_reserve in manila.db.sqlalchemy.api will check the project or user over or not. If user quota >=0, it will check project quota and project quota usage, user quota and user quota usage. In the situation above, project quota (-1) must be smaller than project usage, then the value 'overs' is not None, it will raise ShareLimitExceeded. Actually,it shouldn't raise error.

Changed in manila:
assignee: nobody → zhangqing (zhang-qing)
status: New → In Progress
zhangqing (zhang-qing) on 2020-04-15
description: updated
Vida Haririan (vhariria) on 2020-04-16
Changed in manila:
importance: Undecided → Medium
milestone: none → ussuri-rc1
Goutham Pacha Ravi (gouthamr) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/#/c/713434/

Reviewed: https://review.opendev.org/713434
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=780053968270900a1402fa0db4ae96bd16060ad4
Submitter: Zuul
Branch: master

commit 780053968270900a1402fa0db4ae96bd16060ad4
Author: zhangqing <email address hidden>
Date: Tue Mar 17 20:50:49 2020 +0800

    fix bug in quota checking

    When project quota set unlimited(-1), and user in the
    project is limited to a value.Then project quota must
    smaller than project usage when checking quotas, which
    means the value 'overs' is not None.
    In this case, even though the user not over the quota,
    but they can not create share

    Closes-bug: #1872872

    Change-Id: Id9e2bcb5d30d2b81b0723dd296b537ac7d4519f2

Changed in manila:
status: In Progress → Fix Released

Reviewed: https://review.opendev.org/722034
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=73837ce05a9bf07c7dd4e15c98eee511ff9e1a10
Submitter: Zuul
Branch: stable/train

commit 73837ce05a9bf07c7dd4e15c98eee511ff9e1a10
Author: zhangqing <email address hidden>
Date: Tue Mar 17 20:50:49 2020 +0800

    fix bug in quota checking

    When project quota set unlimited(-1), and user in the
    project is limited to a value.Then project quota must
    smaller than project usage when checking quotas, which
    means the value 'overs' is not None.
    In this case, even though the user not over the quota,
    but they can not create share

    Closes-bug: #1872872

    Change-Id: Id9e2bcb5d30d2b81b0723dd296b537ac7d4519f2
    (cherry picked from commit 780053968270900a1402fa0db4ae96bd16060ad4)

tags: added: in-stable-train

Reviewed: https://review.opendev.org/723641
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=f2afb50fbbd6ec1b14ba93a64d292cbc66e53cfe
Submitter: Zuul
Branch: stable/stein

commit f2afb50fbbd6ec1b14ba93a64d292cbc66e53cfe
Author: zhangqing <email address hidden>
Date: Tue Mar 17 20:50:49 2020 +0800

    fix bug in quota checking

    When project quota set unlimited(-1), and user in the
    project is limited to a value.Then project quota must
    smaller than project usage when checking quotas, which
    means the value 'overs' is not None.
    In this case, even though the user not over the quota,
    but they can not create share

    Closes-bug: #1872872

    Change-Id: Id9e2bcb5d30d2b81b0723dd296b537ac7d4519f2
    (cherry picked from commit 780053968270900a1402fa0db4ae96bd16060ad4)
    (cherry picked from commit 73837ce05a9bf07c7dd4e15c98eee511ff9e1a10)

tags: added: in-stable-stein

Reviewed: https://review.opendev.org/723814
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=b99b57825e9b140e3d6c163a810e7cd49adb6e3d
Submitter: Zuul
Branch: stable/rocky

commit b99b57825e9b140e3d6c163a810e7cd49adb6e3d
Author: zhangqing <email address hidden>
Date: Tue Mar 17 20:50:49 2020 +0800

    fix bug in quota checking

    When project quota set unlimited(-1), and user in the
    project is limited to a value.Then project quota must
    smaller than project usage when checking quotas, which
    means the value 'overs' is not None.
    In this case, even though the user not over the quota,
    but they can not create share

    Closes-bug: #1872872

    Change-Id: Id9e2bcb5d30d2b81b0723dd296b537ac7d4519f2
    (cherry picked from commit 780053968270900a1402fa0db4ae96bd16060ad4)
    (cherry picked from commit 73837ce05a9bf07c7dd4e15c98eee511ff9e1a10)
    (cherry picked from commit f2afb50fbbd6ec1b14ba93a64d292cbc66e53cfe)

tags: added: in-stable-rocky

Reviewed: https://review.opendev.org/724338
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=bc063f06dbdc108ffceec47e1cc8421e13313d8b
Submitter: Zuul
Branch: stable/queens

commit bc063f06dbdc108ffceec47e1cc8421e13313d8b
Author: zhangqing <email address hidden>
Date: Tue Mar 17 20:50:49 2020 +0800

    fix bug in quota checking

    When project quota set unlimited(-1), and user in the
    project is limited to a value.Then project quota must
    smaller than project usage when checking quotas, which
    means the value 'overs' is not None.
    In this case, even though the user not over the quota,
    but they can not create share

    Closes-bug: #1872872

    Change-Id: Id9e2bcb5d30d2b81b0723dd296b537ac7d4519f2
    (cherry picked from commit 780053968270900a1402fa0db4ae96bd16060ad4)
    (cherry picked from commit 73837ce05a9bf07c7dd4e15c98eee511ff9e1a10)
    (cherry picked from commit f2afb50fbbd6ec1b14ba93a64d292cbc66e53cfe)
    (cherry picked from commit b99b57825e9b140e3d6c163a810e7cd49adb6e3d)

tags: added: in-stable-queens
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers