[LU-4028] lfs quota option to print allocated blocks and inode inaddtion to used Created: 30/Sep/13  Updated: 27/May/14  Resolved: 18/Apr/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.1.5
Fix Version/s: Lustre 2.6.0, Lustre 2.5.2

Type: Bug Priority: Major
Reporter: Mahmoud Hanafi Assignee: Niu Yawei (Inactive)
Resolution: Fixed Votes: 0
Labels: mn4

Rank (Obsolete): 10824

 Description   

We are finding that users are running into cases where their used space is less than their soft/hardlimit but what they have been allocated is more. This results in being over quota. But the lfs quota command doesn't print how much a user is allocated. We would like an option to print total allocated blocks and inodes.



 Comments   
Comment by Johann Lombardi (Inactive) [ 02/Oct/13 ]

Mahmound, the "-v" option of the lfs quota command shows you how much quota space is actually allocated to each target. Is that what you are looking for?

Comment by Mahmoud Hanafi [ 29/Oct/13 ]

The -v option will show it for each ost not total. We want it to be printed in the summary. We would also like to request Human readable output option (ie. MB, GB, TB, etc).

Comment by Niu Yawei (Inactive) [ 04/Nov/13 ]

improve lfs quota output to print total allocated block/inode limit and print block space/limit in kbytes/MB/GB/TB: http://review.whamcloud.com/8152

Comment by Jay Lan (Inactive) [ 06/Nov/13 ]

Was your patch against b2_1?

Making all in utils
make[5]: Entering directory `/usr/src/packages/BUILD/lustre-2.1.5/lustre/utils'
make[6]: Entering directory `/usr/src/packages/BUILD/lustre-2.1.5/lustre/utils'
lfs.c:1897: error: expected declaration specifiers or '...' before 'bool'
lfs.c: In function 'print_quota_title':
lfs.c:1903: error: 'human_readable' undeclared (first use in this function)
lfs.c:1903: error: (Each undeclared identifier is reported only once
lfs.c:1903: error: for each function it appears in.)
lfs.c: At top level:
lfs.c:1908: error: expected declaration specifiers or '...' before 'bool'
lfs.c: In function 'kbytes2str':
lfs.c:1910: error: 'h' undeclared (first use in this function)
lfs.c: At top level:
lfs.c:1925: error: expected declaration specifiers or '...' before 'bool'
lfs.c: In function 'print_quota':
lfs.c:1969: error: 'h' undeclared (first use in this function)
lfs.c:1969: error: too many arguments to function 'kbytes2str'
lfs.c:1976: error: too many arguments to function 'kbytes2str'
lfs.c:1983: error: too many arguments to function 'kbytes2str'
lfs.c: At top level:
lfs.c:2027: error: expected declaration specifiers or '...' before 'bool'
lfs.c: In function 'print_obd_quota':
lfs.c:2057: error: 'h' undeclared (first use in this function)
lfs.c:2057: error: too many arguments to function 'print_quota'
lfs.c: In function 'lfs_quota':
lfs.c:2079: error: 'bool' undeclared (first use in this function)
lfs.c:2079: error: expected ';' before 'human_readable'
lfs.c:2120: error: 'human_readable' undeclared (first use in this function)
lfs.c:2120: error: 'true' undeclared (first use in this function)
lfs.c:2193: error: too many arguments to function 'print_quota_title'
lfs.c:2205: error: too many arguments to function 'print_quota'
lfs.c:2211: error: too many arguments to function 'kbytes2str'
lfs.c:2213: error: too many arguments to function 'print_obd_quota'
lfs.c:2215: error: too many arguments to function 'print_obd_quota'
make[6]: *** [lfs.o] Error 1

Comment by Niu Yawei (Inactive) [ 07/Nov/13 ]

The patch is against master, I'll backport it to b2_1 once it landed on master.

Comment by Jodi Levi (Inactive) [ 14/Nov/13 ]

Patch landed to Master. Let me know if more work is needed in this ticket and I'll reopen.

Comment by Peter Jones [ 14/Nov/13 ]

We need this ported to b2_1 and b2_4 for NASA

Comment by Peter Jones [ 18/Nov/13 ]

b2_1 http://review.whamcloud.com/#/c/8283/
b2_4 http://review.whamcloud.com/#/c/8282/

Comment by Oleg Drokin [ 23/Nov/13 ]

We need a documentation update to go along with this change, I think.
Can somebody create an appropriate LUDOC ticket?

Comment by Niu Yawei (Inactive) [ 25/Nov/13 ]

LUDOC-209 is created.

Comment by Mahmoud Hanafi [ 26/Nov/13 ]

I think there is a problem with the patch

this
kbytes2str(total_balloc, strbuf, human_readable);
should be called after print_obd_quota.

2211 +» » kbytes2str(total_balloc, strbuf, human_readable);
2212 +» » rc2 = print_obd_quota(mnt, &qctl, 1, human_readable,
2213 +» » » » &total_ialloc);
2214 +» » rc3 = print_obd_quota(mnt, &qctl, 0, human_readable,
2215 +» » » » &total_balloc);
2216 +» » printf("Total allocated inode limit: "LPU64", total "
2217 +» » "allocated block limit: %s\n", total_ialloc, strbuf);
2218 +» }

Comment by Niu Yawei (Inactive) [ 27/Nov/13 ]

indeed, I'll push a patch to fix it, thank you, Mahmoud.

Comment by Niu Yawei (Inactive) [ 27/Nov/13 ]

http://review.whamcloud.com/8407

Comment by Jay Lan (Inactive) [ 03/Dec/13 ]

Niu, can you provide a 2.4.x version and a 2.1.x version as well? Thanks!

Comment by Niu Yawei (Inactive) [ 04/Dec/13 ]

Niu, can you provide a 2.4.x version and a 2.1.x version as well? Thanks!

Sure, once it passed review and landed on master, I'll port it to b2_4 & b2_1.

Comment by Peter Jones [ 18/Apr/14 ]

Landed for 2.6

Comment by Bob Glossman (Inactive) [ 21/May/14 ]

backports to b2_5:
http://review.whamcloud.com/10411
http://review.whamcloud.com/10412

Generated at Sat Feb 10 01:39:01 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.