]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/quotactl.2
mmap.2: srcfix: note kernel commit that caused MAP_POPULATE | MAP_NONBLOCK to be...
[thirdparty/man-pages.git] / man2 / quotactl.2
1 .\" Copyright (c) 2010, Jan Kara
2 .\" A few pieces copyright (c) 1996 Andries Brouwer (aeb@cwi.nl)
3 .\" and copyright 2010 (c) Michael Kerrisk <mtk.manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of
11 .\" this manual under the conditions for verbatim copying, provided that
12 .\" the entire resulting derived work is distributed under the terms of
13 .\" a permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume
17 .\" no responsibility for errors or omissions, or for damages resulting
18 .\" from the use of the information contained herein. The author(s) may
19 .\" not have taken the same level of care in the production of this
20 .\" manual, which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .TH QUOTACTL 2 2020-04-11 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 quotactl \- manipulate disk quotas
30 .SH SYNOPSIS
31 .nf
32 .B #include <sys/quota.h>
33 .B #include <xfs/xqm.h> /* for XFS quotas */
34 .PP
35 .BI "int quotactl(int " cmd ", const char *" special ", int " id \
36 ", caddr_t " addr );
37 .fi
38 .SH DESCRIPTION
39 .PP
40 The quota system can be used to set per-user, per-group, and per-project limits
41 on the amount of disk space used on a filesystem.
42 For each user and/or group,
43 a soft limit and a hard limit can be set for each filesystem.
44 The hard limit can't be exceeded.
45 The soft limit can be exceeded, but warnings will ensue.
46 Moreover, the user can't exceed the soft limit for more than grace period
47 duration (one week by default) at a time;
48 after this, the soft limit counts as a hard limit.
49 .PP
50 The
51 .BR quotactl ()
52 call manipulates disk quotas.
53 The
54 .I cmd
55 argument indicates a command to be applied to the user or
56 group ID specified in
57 .IR id .
58 To initialize the
59 .IR cmd
60 argument, use the
61 .IR "QCMD(subcmd, type)"
62 macro.
63 The
64 .I type
65 value is either
66 .BR USRQUOTA ,
67 for user quotas,
68 .BR GRPQUOTA ,
69 for group quotas, or (since Linux 4.1)
70 .\" 847aac644e92e5624f2c153bab409bf713d5ff9a
71 .BR PRJQUOTA ,
72 for project quotas.
73 The
74 .I subcmd
75 value is described below.
76 .PP
77 The
78 .I special
79 argument is a pointer to a null-terminated string containing the pathname
80 of the (mounted) block special device for the filesystem being manipulated.
81 .PP
82 The
83 .I addr
84 argument is the address of an optional, command-specific, data structure
85 that is copied in or out of the system.
86 The interpretation of
87 .I addr
88 is given with each operation below.
89 .PP
90 The
91 .I subcmd
92 value is one of the following operations:
93 .TP
94 .B Q_QUOTAON
95 Turn on quotas for a filesystem.
96 The
97 .I id
98 argument is the identification number of the quota format to be used.
99 Currently, there are three supported quota formats:
100 .RS
101 .TP 13
102 .BR QFMT_VFS_OLD
103 The original quota format.
104 .TP
105 .BR QFMT_VFS_V0
106 The standard VFS v0 quota format, which can handle 32-bit UIDs and GIDs
107 and quota limits up to 2^42 bytes and 2^32 inodes.
108 .TP
109 .BR QFMT_VFS_V1
110 A quota format that can handle 32-bit UIDs and GIDs
111 and quota limits of 2^64 bytes and 2^64 inodes.
112 .RE
113 .IP
114 The
115 .IR addr
116 argument points to the pathname of a file containing the quotas for
117 the filesystem.
118 The quota file must exist; it is normally created with the
119 .BR quotacheck (8)
120 program
121 .IP
122 Quota information can be also stored in hidden system inodes
123 for ext4, XFS, and other filesystems if the filesystem is configured so.
124 In this case, there are no visible quota files and there is no need to
125 use
126 .BR quotacheck (8).
127 Quota information is always kept consistent by the filesystem and the
128 .B Q_QUOTAON
129 operation serves only to enable enforcement of quota limits.
130 The presence of hidden
131 system inodes with quota information is indicated by the
132 .B DQF_SYS_FILE
133 flag in the
134 .I dqi_flags
135 field returned by the
136 .B Q_GETINFO
137 operation.
138 .IP
139 This operation requires privilege
140 .RB ( CAP_SYS_ADMIN ).
141 .TP
142 .B Q_QUOTAOFF
143 Turn off quotas for a filesystem.
144 The
145 .I addr
146 and
147 .I id
148 arguments are ignored.
149 This operation requires privilege
150 .RB ( CAP_SYS_ADMIN ).
151 .TP
152 .B Q_GETQUOTA
153 Get disk quota limits and current usage for user or group
154 .IR id .
155 The
156 .I addr
157 argument is a pointer to a
158 .I dqblk
159 structure defined in
160 .IR <sys/quota.h>
161 as follows:
162 .IP
163 .in +4n
164 .EX
165 /* uint64_t is an unsigned 64\-bit integer;
166 uint32_t is an unsigned 32\-bit integer */
167
168 struct dqblk { /* Definition since Linux 2.4.22 */
169 uint64_t dqb_bhardlimit; /* Absolute limit on disk
170 quota blocks alloc */
171 uint64_t dqb_bsoftlimit; /* Preferred limit on
172 disk quota blocks */
173 uint64_t dqb_curspace; /* Current occupied space
174 (in bytes) */
175 uint64_t dqb_ihardlimit; /* Maximum number of
176 allocated inodes */
177 uint64_t dqb_isoftlimit; /* Preferred inode limit */
178 uint64_t dqb_curinodes; /* Current number of
179 allocated inodes */
180 uint64_t dqb_btime; /* Time limit for excessive
181 disk use */
182 uint64_t dqb_itime; /* Time limit for excessive
183 files */
184 uint32_t dqb_valid; /* Bit mask of QIF_*
185 constants */
186 };
187
188 /* Flags in dqb_valid that indicate which fields in
189 dqblk structure are valid. */
190
191 #define QIF_BLIMITS 1
192 #define QIF_SPACE 2
193 #define QIF_ILIMITS 4
194 #define QIF_INODES 8
195 #define QIF_BTIME 16
196 #define QIF_ITIME 32
197 #define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
198 #define QIF_USAGE (QIF_SPACE | QIF_INODES)
199 #define QIF_TIMES (QIF_BTIME | QIF_ITIME)
200 #define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
201 .EE
202 .in
203 .IP
204 The
205 .I dqb_valid
206 field is a bit mask that is set to indicate the entries in the
207 .I dqblk
208 structure that are valid.
209 Currently, the kernel fills in all entries of the
210 .I dqblk
211 structure and marks them as valid in the
212 .I dqb_valid
213 field.
214 Unprivileged users may retrieve only their own quotas;
215 a privileged user
216 .RB ( CAP_SYS_ADMIN )
217 can retrieve the quotas of any user.
218 .TP
219 .BR Q_GETNEXTQUOTA " (since Linux 4.6)"
220 .\" commit 926132c0257a5a8d149a6a395cc3405e55420566
221 This operation is the same as
222 .BR Q_GETQUOTA ,
223 but it returns quota information for the next ID greater than or equal to
224 .IR id
225 that has a quota set.
226 .IP
227 The
228 .I addr
229 argument is a pointer to a
230 .I nextdqblk
231 structure whose fields are as for the
232 .IR dqblk ,
233 except for the addition of a
234 .I dqb_id
235 field that is used to return the ID for which
236 quota information is being returned:
237 .IP
238 .in +4n
239 .EX
240 struct nextdqblk {
241 uint64_t dqb_bhardlimit;
242 uint64_t dqb_bsoftlimit;
243 uint64_t dqb_curspace;
244 uint64_t dqb_ihardlimit;
245 uint64_t dqb_isoftlimit;
246 uint64_t dqb_curinodes;
247 uint64_t dqb_btime;
248 uint64_t dqb_itime;
249 uint32_t dqb_valid;
250 uint32_t dqb_id;
251 };
252 .EE
253 .in
254 .TP
255 .B Q_SETQUOTA
256 Set quota information for user or group
257 .IR id ,
258 using the information supplied in the
259 .I dqblk
260 structure pointed to by
261 .IR addr .
262 The
263 .I dqb_valid
264 field of the
265 .I dqblk
266 structure indicates which entries in the structure have been set by the caller.
267 This operation supersedes the
268 .B Q_SETQLIM
269 and
270 .B Q_SETUSE
271 operations in the previous quota interfaces.
272 This operation requires privilege
273 .RB ( CAP_SYS_ADMIN ).
274 .TP
275 .BR Q_GETINFO " (since Linux 2.4.22)"
276 Get information (like grace times) about quotafile.
277 The
278 .I addr
279 argument should be a pointer to a
280 .I dqinfo
281 structure.
282 This structure is defined in
283 .IR <sys/quota.h>
284 as follows:
285 .IP
286 .in +4n
287 .EX
288 /* uint64_t is an unsigned 64\-bit integer;
289 uint32_t is an unsigned 32\-bit integer */
290
291 struct dqinfo { /* Defined since kernel 2.4.22 */
292 uint64_t dqi_bgrace; /* Time before block soft limit
293 becomes hard limit */
294 uint64_t dqi_igrace; /* Time before inode soft limit
295 becomes hard limit */
296 uint32_t dqi_flags; /* Flags for quotafile
297 (DQF_*) */
298 uint32_t dqi_valid;
299 };
300
301 /* Bits for dqi_flags */
302
303 /* Quota format QFMT_VFS_OLD */
304
305 #define DQF_ROOT_SQUASH (1 << 0) /* Root squash enabled */
306 /* Before Linux v4.0, this had been defined
307 privately as V1_DQF_RSQUASH */
308
309 /* Quota format QFMT_VFS_V0 / QFMT_VFS_V1 */
310
311 #define DQF_SYS_FILE (1 << 16) /* Quota stored in
312 a system file */
313
314 /* Flags in dqi_valid that indicate which fields in
315 dqinfo structure are valid. */
316
317 #define IIF_BGRACE 1
318 #define IIF_IGRACE 2
319 #define IIF_FLAGS 4
320 #define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
321 .EE
322 .in
323 .IP
324 The
325 .I dqi_valid
326 field in the
327 .I dqinfo
328 structure indicates the entries in the structure that are valid.
329 Currently, the kernel fills in all entries of the
330 .I dqinfo
331 structure and marks them all as valid in the
332 .I dqi_valid
333 field.
334 The
335 .I id
336 argument is ignored.
337 .TP
338 .BR Q_SETINFO " (since Linux 2.4.22)"
339 Set information about quotafile.
340 The
341 .I addr
342 argument should be a pointer to a
343 .I dqinfo
344 structure.
345 The
346 .I dqi_valid
347 field of the
348 .I dqinfo
349 structure indicates the entries in the structure
350 that have been set by the caller.
351 This operation supersedes the
352 .B Q_SETGRACE
353 and
354 .B Q_SETFLAGS
355 operations in the previous quota interfaces.
356 The
357 .I id
358 argument is ignored.
359 This operation requires privilege
360 .RB ( CAP_SYS_ADMIN ).
361 .TP
362 .BR Q_GETFMT " (since Linux 2.4.22)"
363 Get quota format used on the specified filesystem.
364 The
365 .I addr
366 argument should be a pointer to a 4-byte buffer
367 where the format number will be stored.
368 .TP
369 .B Q_SYNC
370 Update the on-disk copy of quota usages for a filesystem.
371 If
372 .I special
373 is NULL, then all filesystems with active quotas are sync'ed.
374 The
375 .I addr
376 and
377 .I id
378 arguments are ignored.
379 .TP
380 .BR Q_GETSTATS " (supported up to Linux 2.4.21)"
381 Get statistics and other generic information about the quota subsystem.
382 The
383 .I addr
384 argument should be a pointer to a
385 .I dqstats
386 structure in which data should be stored.
387 This structure is defined in
388 .IR <sys/quota.h> .
389 The
390 .I special
391 and
392 .I id
393 arguments are ignored.
394 .IP
395 This operation is obsolete and was removed in Linux 2.4.22.
396 Files in
397 .I /proc/sys/fs/quota/
398 carry the information instead.
399 .PP
400 For XFS filesystems making use of the XFS Quota Manager (XQM),
401 the above operations are bypassed and the following operations are used:
402 .TP
403 .B Q_XQUOTAON
404 Turn on quotas for an XFS filesystem.
405 XFS provides the ability to turn on/off quota limit enforcement
406 with quota accounting.
407 Therefore, XFS expects
408 .I addr
409 to be a pointer to an
410 .I "unsigned int"
411 that contains a bit-wise combination of the following flags (defined in
412 .IR <xfs/xqm.h> ):
413 .IP
414 .in +4n
415 .EX
416 XFS_QUOTA_UDQ_ACCT /* User quota accounting */
417 XFS_QUOTA_UDQ_ENFD /* User quota limits enforcement */
418 XFS_QUOTA_GDQ_ACCT /* Group quota accounting */
419 XFS_QUOTA_GDQ_ENFD /* Group quota limits enforcement */
420 XFS_QUOTA_PDQ_ACCT /* Project quota accounting */
421 XFS_QUOTA_PDQ_ENFD /* Project quota limits enforcement */
422 .EE
423 .in
424 .IP
425 This operation requires privilege
426 .RB ( CAP_SYS_ADMIN ).
427 The
428 .I id
429 argument is ignored.
430 .TP
431 .B Q_XQUOTAOFF
432 Turn off quotas for an XFS filesystem.
433 As with
434 .BR Q_QUOTAON ,
435 XFS filesystems expect a pointer to an
436 .I "unsigned int"
437 that specifies whether quota accounting and/or limit enforcement need
438 to be turned off (using the same flags as for
439 .B Q_XQUOTAON
440 operation).
441 This operation requires privilege
442 .RB ( CAP_SYS_ADMIN ).
443 The
444 .I id
445 argument is ignored.
446 .TP
447 .B Q_XGETQUOTA
448 Get disk quota limits and current usage for user
449 .IR id .
450 The
451 .I addr
452 argument is a pointer to an
453 .I fs_disk_quota
454 structure, which is defined in
455 .I <xfs/xqm.h>
456 as follows:
457 .IP
458 .in +4n
459 .EX
460 /* All the blk units are in BBs (Basic Blocks) of
461 512 bytes. */
462
463 #define FS_DQUOT_VERSION 1 /* fs_disk_quota.d_version */
464
465 #define XFS_USER_QUOTA (1<<0) /* User quota type */
466 #define XFS_PROJ_QUOTA (1<<1) /* Project quota type */
467 #define XFS_GROUP_QUOTA (1<<2) /* Group quota type */
468
469 struct fs_disk_quota {
470 int8_t d_version; /* Version of this structure */
471 int8_t d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */
472 uint16_t d_fieldmask; /* Field specifier */
473 uint32_t d_id; /* User, project, or group ID */
474 uint64_t d_blk_hardlimit; /* Absolute limit on
475 disk blocks */
476 uint64_t d_blk_softlimit; /* Preferred limit on
477 disk blocks */
478 uint64_t d_ino_hardlimit; /* Maximum # allocated
479 inodes */
480 uint64_t d_ino_softlimit; /* Preferred inode limit */
481 uint64_t d_bcount; /* # disk blocks owned by
482 the user */
483 uint64_t d_icount; /* # inodes owned by the user */
484 int32_t d_itimer; /* Zero if within inode limits */
485 /* If not, we refuse service */
486 int32_t d_btimer; /* Similar to above; for
487 disk blocks */
488 uint16_t d_iwarns; /* # warnings issued with
489 respect to # of inodes */
490 uint16_t d_bwarns; /* # warnings issued with
491 respect to disk blocks */
492 int32_t d_padding2; /* Padding - for future use */
493 uint64_t d_rtb_hardlimit; /* Absolute limit on realtime
494 (RT) disk blocks */
495 uint64_t d_rtb_softlimit; /* Preferred limit on RT
496 disk blocks */
497 uint64_t d_rtbcount; /* # realtime blocks owned */
498 int32_t d_rtbtimer; /* Similar to above; for RT
499 disk blocks */
500 uint16_t d_rtbwarns; /* # warnings issued with
501 respect to RT disk blocks */
502 int16_t d_padding3; /* Padding - for future use */
503 char d_padding4[8]; /* Yet more padding */
504 };
505 .EE
506 .in
507 .IP
508 Unprivileged users may retrieve only their own quotas;
509 a privileged user
510 .RB ( CAP_SYS_ADMIN )
511 may retrieve the quotas of any user.
512 .TP
513 .BR Q_XGETNEXTQUOTA " (since Linux 4.6)"
514 .\" commit 8b37524962b9c54423374717786198f5c0820a28
515 This operation is the same as
516 .BR Q_XGETQUOTA ,
517 but it returns (in the
518 .I fs_disk_quota
519 structure pointed by
520 .IR addr )
521 quota information for the next ID greater than or equal to
522 .IR id
523 that has a quota set.
524 Note that since
525 .I fs_disk_quota
526 already has
527 .I q_id
528 field, no separate structure type is needed (in contrast with
529 .B Q_GETQUOTA
530 and
531 .B Q_GETNEXTQUOTA
532 operations)
533 .TP
534 .B Q_XSETQLIM
535 Set disk quota limits for user
536 .IR id .
537 The
538 .I addr
539 argument is a pointer to an
540 .I fs_disk_quota
541 structure.
542 This operation requires privilege
543 .RB ( CAP_SYS_ADMIN ).
544 .TP
545 .B Q_XGETQSTAT
546 Returns XFS filesystem-specific quota information in the
547 .I fs_quota_stat
548 structure pointed by
549 .IR addr .
550 This is useful for finding out how much space is used to store quota
551 information, and also to get the quota on/off status of a given local XFS
552 filesystem.
553 The
554 .I fs_quota_stat
555 structure itself is defined as follows:
556 .IP
557 .in +4n
558 .EX
559 #define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */
560
561 struct fs_qfilestat {
562 uint64_t qfs_ino; /* Inode number */
563 uint64_t qfs_nblks; /* Number of BBs
564 512-byte-blocks */
565 uint32_t qfs_nextents; /* Number of extents */
566 };
567
568 struct fs_quota_stat {
569 int8_t qs_version; /* Version number for
570 future changes */
571 uint16_t qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
572 int8_t qs_pad; /* Unused */
573 struct fs_qfilestat qs_uquota; /* User quota storage
574 information */
575 struct fs_qfilestat qs_gquota; /* Group quota storage
576 information */
577 uint32_t qs_incoredqs; /* Number of dquots in core */
578 int32_t qs_btimelimit; /* Limit for blocks timer */
579 int32_t qs_itimelimit; /* Limit for inodes timer */
580 int32_t qs_rtbtimelimit;/* Limit for RT
581 blocks timer */
582 uint16_t qs_bwarnlimit; /* Limit for # of warnings */
583 uint16_t qs_iwarnlimit; /* Limit for # of warnings */
584 };
585 .EE
586 .in
587 .IP
588 The
589 .I id
590 argument is ignored.
591 .TP
592 .B Q_XGETQSTATV
593 Returns XFS filesystem-specific quota information in the
594 .I fs_quota_statv
595 pointed to by
596 .IR addr .
597 This version of the operation uses a structure with proper versioning support,
598 along with appropriate layout (all fields are naturally aligned) and
599 padding to avoiding special compat handling;
600 it also provides the ability to get statistics regarding
601 the project quota file.
602 The
603 .I fs_quota_statv
604 structure itself is defined as follows:
605 .IP
606 .in +4n
607 .EX
608 #define FS_QSTATV_VERSION1 1 /* fs_quota_statv.qs_version */
609
610 struct fs_qfilestatv {
611 uint64_t qfs_ino; /* Inode number */
612 uint64_t qfs_nblks; /* Number of BBs
613 512-byte-blocks */
614 uint32_t qfs_nextents; /* Number of extents */
615 uint32_t qfs_pad; /* Pad for 8-byte alignment */
616 };
617
618 struct fs_quota_statv {
619 int8_t qs_version; /* Version for future
620 changes */
621 uint8_t qs_pad1; /* Pad for 16-bit alignment */
622 uint16_t qs_flags; /* XFS_QUOTA_.* flags */
623 uint32_t qs_incoredqs; /* Number of dquots incore */
624 struct fs_qfilestatv qs_uquota; /* User quota
625 information */
626 struct fs_qfilestatv qs_gquota; /* Group quota
627 information */
628 struct fs_qfilestatv qs_pquota; /* Project quota
629 information */
630 int32_t qs_btimelimit; /* Limit for blocks timer */
631 int32_t qs_itimelimit; /* Limit for inodes timer */
632 int32_t qs_rtbtimelimit; /* Limit for RT blocks
633 timer */
634 uint16_t qs_bwarnlimit; /* Limit for # of warnings */
635 uint16_t qs_iwarnlimit; /* Limit for # of warnings */
636 uint64_t qs_pad2[8]; /* For future proofing */
637 };
638 .EE
639 .in
640 .IP
641 The
642 .I qs_version
643 field of the structure should be filled with the version of the structure
644 supported by the callee (for now, only
645 .I FS_QSTAT_VERSION1
646 is supported).
647 The kernel will fill the structure in accordance with
648 version provided.
649 The
650 .I id
651 argument is ignored.
652 .TP
653 .B Q_XQUOTARM " (since Linux 3.16)"
654 .\" 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc
655 Free the disk space taken by disk quotas.
656 The
657 .I addr
658 argument should be a pointer to an
659 .I "unsigned int"
660 value containing flags (the same as in
661 .I d_flags
662 field of
663 .I fs_disk_quota
664 structure)
665 which identify what types of quota
666 should be removed.
667 (Note that the quota type passed in the
668 .I cmd
669 argument is ignored, but should remain valid in order to pass preliminary
670 quotactl syscall handler checks.)
671 .IP
672 Quotas must have already been turned off.
673 The
674 .I id
675 argument is ignored.
676 .TP
677 .BR Q_XQUOTASYNC " (since Linux 2.6.15; no-op since Linux 3.4)"
678 .\" Added in commit ee34807a65aa0c5911dc27682863afca780a003e
679 This operation was an XFS quota equivalent to
680 .BR Q_SYNC ,
681 but it is no-op since Linux 3.4,
682 .\" 4b217ed9e30f94b6e8e5e262020ef0ceab6113af
683 as
684 .BR sync (1)
685 writes quota information to disk now
686 (in addition to the other filesystem metadata that it writes out).
687 The
688 .IR special ", " id " and " addr
689 arguments are ignored.
690 .SH RETURN VALUE
691 .PP
692 On success,
693 .BR quotactl ()
694 returns 0; on error \-1
695 is returned, and
696 .I errno
697 is set to indicate the error.
698 .SH ERRORS
699 .TP
700 .B EACCES
701 .I cmd
702 is
703 .BR Q_QUOTAON ,
704 and the quota file pointed to by
705 .I addr
706 exists, but is not a regular file or
707 is not on the filesystem pointed to by
708 .IR special .
709 .TP
710 .B EBUSY
711 .I cmd
712 is
713 .BR Q_QUOTAON ,
714 but another
715 .B Q_QUOTAON
716 had already been performed.
717 .TP
718 .B EFAULT
719 .I addr
720 or
721 .I special
722 is invalid.
723 .TP
724 .B EINVAL
725 .I cmd
726 or
727 .I type
728 is invalid.
729 .TP
730 .B EINVAL
731 .I cmd
732 is
733 .BR Q_QUOTAON ,
734 but the specified quota file is corrupted.
735 .TP
736 .BR EINVAL " (since Linux 5.5)"
737 .\" 3dd4d40b420846dd35869ccc8f8627feef2cff32
738 .I cmd
739 is
740 .BR Q_XQUOTARM ,
741 but
742 .I addr
743 does not point to valid quota types.
744 .TP
745 .B ENOENT
746 The file specified by
747 .I special
748 or
749 .I addr
750 does not exist.
751 .TP
752 .B ENOSYS
753 The kernel has not been compiled with the
754 .B CONFIG_QUOTA
755 option.
756 .TP
757 .B ENOTBLK
758 .I special
759 is not a block device.
760 .TP
761 .B EPERM
762 The caller lacked the required privilege
763 .RB ( CAP_SYS_ADMIN )
764 for the specified operation.
765 .TP
766 .B ERANGE
767 .I cmd
768 is
769 .BR Q_SETQUOTA ,
770 but the specified limits are out of the range allowed by the quota format.
771 .TP
772 .B ESRCH
773 No disk quota is found for the indicated user.
774 Quotas have not been turned on for this filesystem.
775 .TP
776 .B ESRCH
777 .I cmd
778 is
779 .BR Q_QUOTAON ,
780 but the specified quota format was not found.
781 .TP
782 .B ESRCH
783 .I cmd
784 is
785 .B Q_GETNEXTQUOTA
786 or
787 .BR Q_XGETNEXTQUOTA ,
788 but there is no ID greater than or equal to
789 .IR id
790 that has an active quota.
791 .SH NOTES
792 Instead of
793 .I <xfs/xqm.h>
794 one can use
795 .IR <linux/dqblk_xfs.h> ,
796 taking into account that there are several naming discrepancies:
797 .IP \(bu 3
798 Quota enabling flags (of format
799 .BR XFS_QUOTA_[UGP]DQ_{ACCT,ENFD} )
800 are defined without a leading "X", as
801 .BR FS_QUOTA_[UGP]DQ_{ACCT,ENFD} .
802 .IP \(bu
803 The same is true for
804 .B XFS_{USER,GROUP,PROJ}_QUOTA
805 quota type flags, which are defined as
806 .BR FS_{USER,GROUP,PROJ}_QUOTA .
807 .IP \(bu
808 The
809 .I dqblk_xfs.h
810 header file defines its own
811 .BR XQM_USRQUOTA ,
812 .BR XQM_GRPQUOTA ,
813 and
814 .B XQM_PRJQUOTA
815 constants for the available quota types, but their values are the same as for
816 constants without the
817 .B XQM_
818 prefix.
819 .SH SEE ALSO
820 .BR quota (1),
821 .BR getrlimit (2),
822 .BR quotacheck (8),
823 .BR quotaon (8)