[LU-14739]  capablity check should be aware of root squash Created: 07/Jun/21  Updated: 09/Nov/22  Resolved: 10/Oct/21

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.15.0

Type: Bug Priority: Minor
Reporter: Wang Shilong (Inactive) Assignee: Wang Shilong (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-14901 consume grants if async write fallbac... Open
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

If root squashed enabled, CAP check should use squash_uid/gid,  quota is one of case hitting problem, as root could exceeding root limits.



 Comments   
Comment by Gerrit Updater [ 07/Jun/21 ]

.

Comment by Gerrit Updater [ 09/Jun/21 ]

Wang Shilong (wshilong@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/43956
Subject: LU-14739 quota: fix CAP_SYS_RESOURCE check for IO
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1bceed7ca56c977028b72e7b398129dd386f2586

Comment by Gerrit Updater [ 11/Jun/21 ]

Sebastien Buisson (sbuisson@ddn.com) uploaded a new patch: https://review.whamcloud.com/43988
Subject: LU-14739 quota: nodemap squashed root cannot bypass quota
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 891a607f74a63ad01a0e6eba28a12c502db3c785

Comment by Gerrit Updater [ 12/Jul/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/43988/
Subject: LU-14739 quota: nodemap squashed root cannot bypass quota
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: a4fbe7341baf12c00c6048bb290f8aa26c05cbac

Comment by Peter Jones [ 12/Jul/21 ]

Landed for 2.15

Comment by Andreas Dilger [ 15/Jul/21 ]

Alex wrote:

i'm getting sanity-quota/10 failures with LU-14739 quota: nodemap squashed root cannot bypass quota, every run (locally)

Comment by Andreas Dilger [ 18/Jul/21 ]

Alex, did you have any more information about the failure you hit with this patch?

Comment by Alex Zhuravlev [ 19/Jul/21 ]

reverting this part fixes sanity-quota/10 on my setup:

@@ -2309,7 +2309,7 @@ int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
        }
 
        /* check if the file's owner/group is over quota */
-       if (!io->ci_noquota) {
+       if (!(cmd & OBD_BRW_NOQUOTA)) {
Comment by Gerrit Updater [ 20/Jul/21 ]

Wang Shilong (wshilong@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/44347
Subject: LU-14739 quota: don't return quota flags for root
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 7d78fbba52b95fff9efc4cfe7913a213bfb8f691

Comment by Wang Shilong (Inactive) [ 20/Jul/21 ]

bzzz would you give this patch a try? reverting that part will break original problem we want to fix.

Comment by Alex Zhuravlev [ 20/Jul/21 ]

the strange thing is that OSTSIZE=800000 (it's 400000 by default here) fixes the issue as well.

Comment by Alex Zhuravlev [ 20/Jul/21 ]

Alex Zhuravlev would you give this patch a try? reverting that part will break original problem we want to fix.

no, test 10 still fail

Comment by Wang Shilong (Inactive) [ 21/Jul/21 ]

I was able to reproduce problem with OSTSIZE=400000 and i confirmed latest patch help fix issue locally.

Comment by Wang Shilong (Inactive) [ 01/Aug/21 ]

btw, LU-14901 is direct reason why sanity-quota 10 could fail, and patch "LU-14739: quota: nodemap squashed root cannot bypass quota" help expose this bug, i opened new ticket to fix this issue since this is not a regression from this ticket, and there are few regressions problem addressed by https://review.whamcloud.com/#/c/44347/

Comment by Gerrit Updater [ 10/Oct/21 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/44347/
Subject: LU-14739 quota: fix quota with root squash enabled
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: bbfdc7c1670c92747a8f98d39e1e43dc39e59e30

Comment by Peter Jones [ 10/Oct/21 ]

Landed for 2.15

Generated at Sat Feb 10 03:12:21 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.