← Documents Documentation/filesystems/quota.rst GitHub 원문 ↗

Linux 6.18.37 · Filesystems

Quota subsystem

Quota soft·hard limit와 VFS_DQUOT generic netlink 경고 ABI의 전문 번역입니다.

Source pathDocumentation/filesystems/quota.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

quota.rst:1-85

Linux quota는 사용자·그룹별 공간 및 inode 사용량에 softlimit·hardlimit를 적용한다. Softlimit는 grace time 동안만 넘을 수 있고 hardlimit는 `CAP_SYS_RESOURCE` 예외를 제외하면 넘을 수 없다.

`VFS_DQUOT` generic netlink 인터페이스는 제한 초과와 복귀 이벤트를 userspace에 전달한다. 프로토콜이 namespace-aware가 아니므로 initial network namespace에서만 메시지를 받는다는 점이 배포와 모니터링에서 중요하다.

Quota 이벤트 전달
사용 공간 또는 inode 수 변화soft·hard·grace 상태 판정`QUOTA_NL_C_WARNING` 생성6개 속성으로 대상과 장치 식별initial network namespace의 userspace 수신

파일시스템 사용량 변화가 구조화된 netlink 경고로 변환된다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ===============
4 Quota subsystem
5 ===============
6
7 Quota subsystem allows system administrator to set limits on used space and
8 number of used inodes (inode is a filesystem structure which is associated with
9 each file or directory) for users and/or groups. For both used space and number
10 of used inodes there are actually two limits. The first one is called softlimit
11 and the second one hardlimit. A user can never exceed a hardlimit for any
12 resource (unless he has CAP_SYS_RESOURCE capability). User is allowed to exceed
13 softlimit but only for limited period of time. This period is called "grace
14 period" or "grace time". When grace time is over, user is not able to allocate
15 more space/inodes until he frees enough of them to get below softlimit.
16
17 Quota limits (and amount of grace time) are set independently for each
18 filesystem.
19
20 For more details about quota design, see the documentation in quota-tools package
21 (https://sourceforge.net/projects/linuxquota).
22
23 Quota netlink interface
24 =======================
25 When user exceeds a softlimit, runs out of grace time or reaches hardlimit,
26 quota subsystem traditionally printed a message to the controlling terminal of
27 the process which caused the excess. This method has the disadvantage that
28 when user is using a graphical desktop he usually cannot see the message.
29 Thus quota netlink interface has been designed to pass information about
30 the above events to userspace. There they can be captured by an application
31 and processed accordingly.
32
33 The interface uses generic netlink framework (see
34 https://lwn.net/Articles/208755/ and http://www.infradead.org/~tgr/libnl/ for
35 more details about this layer). The name of the quota generic netlink interface
36 is "VFS_DQUOT". Definitions of constants below are in <linux/quota.h>. Since
37 the quota netlink protocol is not namespace aware, quota netlink messages are
38 sent only in initial network namespace.
39
40 Currently, the interface supports only one message type QUOTA_NL_C_WARNING.
41 This command is used to send a notification about any of the above mentioned
42 events. Each message has six attributes. These are (type of the argument is
43 in parentheses):
44
45 QUOTA_NL_A_QTYPE (u32)
46 - type of quota being exceeded (one of USRQUOTA, GRPQUOTA)
47 QUOTA_NL_A_EXCESS_ID (u64)
48 - UID/GID (depends on quota type) of user / group whose limit
49 is being exceeded.
50 QUOTA_NL_A_CAUSED_ID (u64)
51 - UID of a user who caused the event
52 QUOTA_NL_A_WARNING (u32)
53 - what kind of limit is exceeded:
54
55 QUOTA_NL_IHARDWARN
56 inode hardlimit
57 QUOTA_NL_ISOFTLONGWARN
58 inode softlimit is exceeded longer
59 than given grace period
60 QUOTA_NL_ISOFTWARN
61 inode softlimit
62 QUOTA_NL_BHARDWARN
63 space (block) hardlimit
64 QUOTA_NL_BSOFTLONGWARN
65 space (block) softlimit is exceeded
66 longer than given grace period.
67 QUOTA_NL_BSOFTWARN
68 space (block) softlimit
69
70 - four warnings are also defined for the event when user stops
71 exceeding some limit:
72
73 QUOTA_NL_IHARDBELOW
74 inode hardlimit
75 QUOTA_NL_ISOFTBELOW
76 inode softlimit
77 QUOTA_NL_BHARDBELOW
78 space (block) hardlimit
79 QUOTA_NL_BSOFTBELOW
80 space (block) softlimit
81
82 QUOTA_NL_A_DEV_MAJOR (u32)
83 - major number of a device with the affected filesystem
84 QUOTA_NL_A_DEV_MINOR (u32)
85 - minor number of a device with the affected filesystem
86

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Quota 제한과 grace time

1-22

Quota 서브시스템은 시스템 관리자가 사용자와 그룹별로 사용 공간과 사용 inode 수의 한도를 설정하게 한다. inode는 각 파일 또는 디렉터리에 연결된 파일시스템 구조다.

공간과 inode 수에는 각각 softlimit와 hardlimit가 있다. 사용자는 `CAP_SYS_RESOURCE` capability가 없는 한 어떤 자원의 hardlimit도 넘을 수 없다. softlimit는 일정 기간 넘을 수 있으며 이 기간을 grace period 또는 grace time이라고 한다.

Grace time이 끝나면 사용량을 softlimit 아래로 충분히 낮출 때까지 공간이나 inode를 더 할당할 수 없다. Quota 한도와 grace time은 파일시스템마다 독립적으로 설정한다.

더 자세한 quota 설계는 quota-tools 패키지 문서를 참고한다. 원문은 `https://sourceforge.net/projects/linuxquota`를 안내한다.

Quota 제한 단계
제한초과 가능 여부결과
softlimitgrace time 동안 가능기간 만료 뒤 추가 할당 중지
hardlimit원칙적으로 불가`CAP_SYS_RESOURCE` 보유자는 예외
복구 조건사용량을 softlimit 아래로 낮춤공간·inode 추가 할당 재개

두 자원에 같은 soft·hard 제한 모델을 적용한다.

.. SPDX-License-Identifier: GPL-2.0

===============
Quota subsystem
===============

Quota subsystem allows system administrator to set limits on used space and
number of used inodes (inode is a filesystem structure which is associated with
each file or directory) for users and/or groups. For both used space and number
of used inodes there are actually two limits. The first one is called softlimit
and the second one hardlimit.  A user can never exceed a hardlimit for any
resource (unless he has CAP_SYS_RESOURCE capability). User is allowed to exceed
softlimit but only for limited period of time. This period is called "grace
period" or "grace time". When grace time is over, user is not able to allocate
more space/inodes until he frees enough of them to get below softlimit.

Quota limits (and amount of grace time) are set independently for each
filesystem.

For more details about quota design, see the documentation in quota-tools package
(https://sourceforge.net/projects/linuxquota).