linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] quotactl.2: Add some details about Q_QUOTAON
@ 2019-10-24  8:11 Yang Xu
  2019-10-24  9:55 ` Jan Kara
  0 siblings, 1 reply; 5+ messages in thread
From: Yang Xu @ 2019-10-24  8:11 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man, jack, Yang Xu

For Q_QUOTAON, on old kernel we can use quotacheck -ug to
generate quota files. But in current kernel, we can also hide them
in system inodes and indicate them by using "quota" or project feature.

For user or group quota, we can do as below(etc ext4):
mkfs.ext4 -F -o quota /dev/sda5
mount /dev/sda5 /mnt
quotactl(QCMD(Q_QUOTAON, USRQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);

For project quota, we can do as below(etc ext4)
mkfs.ext4 -F -o quota,project /dev/sda5
mount /dev/sda5 /mnt
quotactl(QCMD(Q_QUOTAON, PRJQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 man2/quotactl.2 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/man2/quotactl.2 b/man2/quotactl.2
index e0d40a2be..b5abc64b2 100644
--- a/man2/quotactl.2
+++ b/man2/quotactl.2
@@ -117,7 +117,10 @@ argument points to the pathname of a file containing the quotas for
 the filesystem.
 The quota file must exist; it is normally created with the
 .BR quotacheck (8)
-program.
+program. It also can been stored as hidden system inode. In this case, there
+are no visible quota files in filesystem and no need to use
+.BR quotacheck (8)
+program. This is indicated by 'quota' and 'project' features.
 This operation requires privilege
 .RB ( CAP_SYS_ADMIN ).
 .TP 8
@@ -638,7 +641,8 @@ The
 .I id
 argument is ignored.
 .TP
-.B Q_XQUOTARM
+.B Q_XQUOTARM (Since linux 3.16)
+.\" 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc
 Free the disk space taken by disk quotas. The
 .I addr
 argument should be a pointer to an
-- 
2.18.0




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] quotactl.2: Add some details about Q_QUOTAON
  2019-10-24  8:11 [PATCH] quotactl.2: Add some details about Q_QUOTAON Yang Xu
@ 2019-10-24  9:55 ` Jan Kara
  2019-10-24 10:03   ` Yang Xu
  2019-10-25  6:06   ` [PATCH v2] " Yang Xu
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Kara @ 2019-10-24  9:55 UTC (permalink / raw)
  To: Yang Xu; +Cc: mtk.manpages, linux-man, jack

On Thu 24-10-19 16:11:33, Yang Xu wrote:
> For Q_QUOTAON, on old kernel we can use quotacheck -ug to
> generate quota files. But in current kernel, we can also hide them
> in system inodes and indicate them by using "quota" or project feature.
> 
> For user or group quota, we can do as below(etc ext4):
> mkfs.ext4 -F -o quota /dev/sda5
> mount /dev/sda5 /mnt
> quotactl(QCMD(Q_QUOTAON, USRQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);
> 
> For project quota, we can do as below(etc ext4)
> mkfs.ext4 -F -o quota,project /dev/sda5
> mount /dev/sda5 /mnt
> quotactl(QCMD(Q_QUOTAON, PRJQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);
> 
> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>

...
>  The quota file must exist; it is normally created with the
>  .BR quotacheck (8)
> -program.
> +program. It also can been stored as hidden system inode. In this case, there
> +are no visible quota files in filesystem and no need to use
> +.BR quotacheck (8)
> +program. This is indicated by 'quota' and 'project' features.
>  This operation requires privilege
>  .RB ( CAP_SYS_ADMIN ).
>  .TP 8

This is a good clarification. Thanks! I'd just somewhat expand this like:

Quota information can be also stored in hidden system inodes for ext4, xfs,
and other filesystems if the filesystem is configured so. In this case,
there are no visible quota files and there is no need to use quotacheck(8).
Quota information is always kept consistent by the filesystem and Q_QUOTAON
quotactl only enables enforcement of quota limits. The presence of hidden
system inodes with quota information is indicated by DQF_SYS_FILE flag in
Q_GETINFO output.

> @@ -638,7 +641,8 @@ The
>  .I id
>  argument is ignored.
>  .TP
> -.B Q_XQUOTARM
> +.B Q_XQUOTARM (Since linux 3.16)
> +.\" 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc

Not sure if we need to specify commit ID here...

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] quotactl.2: Add some details about Q_QUOTAON
  2019-10-24  9:55 ` Jan Kara
@ 2019-10-24 10:03   ` Yang Xu
  2019-10-25  6:06   ` [PATCH v2] " Yang Xu
  1 sibling, 0 replies; 5+ messages in thread
From: Yang Xu @ 2019-10-24 10:03 UTC (permalink / raw)
  To: Jan Kara; +Cc: mtk.manpages, linux-man



on 2019/10/24 17:55, Jan Kara wrote:
> On Thu 24-10-19 16:11:33, Yang Xu wrote:
>> For Q_QUOTAON, on old kernel we can use quotacheck -ug to
>> generate quota files. But in current kernel, we can also hide them
>> in system inodes and indicate them by using "quota" or project feature.
>>
>> For user or group quota, we can do as below(etc ext4):
>> mkfs.ext4 -F -o quota /dev/sda5
>> mount /dev/sda5 /mnt
>> quotactl(QCMD(Q_QUOTAON, USRQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);
>>
>> For project quota, we can do as below(etc ext4)
>> mkfs.ext4 -F -o quota,project /dev/sda5
>> mount /dev/sda5 /mnt
>> quotactl(QCMD(Q_QUOTAON, PRJQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);
>>
>> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
> 
> ...
>>   The quota file must exist; it is normally created with the
>>   .BR quotacheck (8)
>> -program.
>> +program. It also can been stored as hidden system inode. In this case, there
>> +are no visible quota files in filesystem and no need to use
>> +.BR quotacheck (8)
>> +program. This is indicated by 'quota' and 'project' features.
>>   This operation requires privilege
>>   .RB ( CAP_SYS_ADMIN ).
>>   .TP 8
> 
> This is a good clarification. Thanks! I'd just somewhat expand this like:
> 
> Quota information can be also stored in hidden system inodes for ext4, xfs,
> and other filesystems if the filesystem is configured so. In this case,
> there are no visible quota files and there is no need to use quotacheck(8).
> Quota information is always kept consistent by the filesystem and Q_QUOTAON
> quotactl only enables enforcement of quota limits. The presence of hidden
> system inodes with quota information is indicated by DQF_SYS_FILE flag in
> Q_GETINFO output.
Good. It is very professional.
> 
>> @@ -638,7 +641,8 @@ The
>>   .I id
>>   argument is ignored.
>>   .TP
>> -.B Q_XQUOTARM
>> +.B Q_XQUOTARM (Since linux 3.16)
>> +.\" 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc
> 
> Not sure if we need to specify commit ID here...

It is only a supplementary explanation. Other flag has similar id 
message such as Q_XGETNEXTQUOTA in quotactl.2
------
.BR Q_XGETNEXTQUOTA " (since Linux 4.6)"
.\" commit 8b37524962b9c54423374717786198f5c0820a28
------
So, I think it is no problem.
> 
> 								Honza
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] quotactl.2: Add some details about Q_QUOTAON
  2019-10-24  9:55 ` Jan Kara
  2019-10-24 10:03   ` Yang Xu
@ 2019-10-25  6:06   ` Yang Xu
  2019-10-31  6:04     ` Michael Kerrisk (man-pages)
  1 sibling, 1 reply; 5+ messages in thread
From: Yang Xu @ 2019-10-25  6:06 UTC (permalink / raw)
  To: mtk.manpages, jack; +Cc: linux-man, Yang Xu

For Q_QUOTAON, on old kernel we can use quotacheck -ug to
generate quota files. But in current kernel, we can also hide them
in system inodes and indicate them by using "quota" or project feature.

For user or group quota, we can do as below(etc ext4):
mkfs.ext4 -F -o quota /dev/sda5
mount /dev/sda5 /mnt
quotactl(QCMD(Q_QUOTAON, USRQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);

For project quota, we can do as below(etc ext4)
mkfs.ext4 -F -o quota,project /dev/sda5
mount /dev/sda5 /mnt
quotactl(QCMD(Q_QUOTAON, PRJQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 man2/quotactl.2 | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/man2/quotactl.2 b/man2/quotactl.2
index e0d40a2be..215ec6252 100644
--- a/man2/quotactl.2
+++ b/man2/quotactl.2
@@ -117,7 +117,15 @@ argument points to the pathname of a file containing the quotas for
 the filesystem.
 The quota file must exist; it is normally created with the
 .BR quotacheck (8)
-program.
+program. Quota information can be also stored in hidden system inodes
+for ext4, xfs and other filesystems if the filesystem is configured so.
+In this case, there are no visible quota files and there is no need to
+use
+.BR quotacheck (8).
+Quota information is always kept consistent by the filesystem and Q_QUOTAON
+quotactl only enables enforcement of quota limits. The presence of hidden
+system inodes with quota information is indicated by DQF_SYS_FILE flag in
+Q_GETINFO output.
 This operation requires privilege
 .RB ( CAP_SYS_ADMIN ).
 .TP 8
@@ -638,7 +646,8 @@ The
 .I id
 argument is ignored.
 .TP
-.B Q_XQUOTARM
+.B Q_XQUOTARM() " (since Linux 3.16)"
+.\" 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc
 Free the disk space taken by disk quotas. The
 .I addr
 argument should be a pointer to an
-- 
2.18.0




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] quotactl.2: Add some details about Q_QUOTAON
  2019-10-25  6:06   ` [PATCH v2] " Yang Xu
@ 2019-10-31  6:04     ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2019-10-31  6:04 UTC (permalink / raw)
  To: Yang Xu, jack; +Cc: mtk.manpages, linux-man

Hello Yang Xu and Jan

On 10/25/19 8:06 AM, Yang Xu wrote:
> For Q_QUOTAON, on old kernel we can use quotacheck -ug to
> generate quota files. But in current kernel, we can also hide them
> in system inodes and indicate them by using "quota" or project feature.
> 
> For user or group quota, we can do as below(etc ext4):
> mkfs.ext4 -F -o quota /dev/sda5
> mount /dev/sda5 /mnt
> quotactl(QCMD(Q_QUOTAON, USRQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);
> 
> For project quota, we can do as below(etc ext4)
> mkfs.ext4 -F -o quota,project /dev/sda5
> mount /dev/sda5 /mnt
> quotactl(QCMD(Q_QUOTAON, PRJQUOTA), /dev/sda5, QFMT_VFS_V0, NULL);

Thanks for the patch, Yang Xu, and thanks for the additional input,
Jan.

Patch applied, and a few wording tweaks added.

Thanks,

Michael

> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
> ---
>   man2/quotactl.2 | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/man2/quotactl.2 b/man2/quotactl.2
> index e0d40a2be..215ec6252 100644
> --- a/man2/quotactl.2
> +++ b/man2/quotactl.2
> @@ -117,7 +117,15 @@ argument points to the pathname of a file containing the quotas for
>   the filesystem.
>   The quota file must exist; it is normally created with the
>   .BR quotacheck (8)
> -program.
> +program. Quota information can be also stored in hidden system inodes
> +for ext4, xfs and other filesystems if the filesystem is configured so.
> +In this case, there are no visible quota files and there is no need to
> +use
> +.BR quotacheck (8).
> +Quota information is always kept consistent by the filesystem and Q_QUOTAON
> +quotactl only enables enforcement of quota limits. The presence of hidden
> +system inodes with quota information is indicated by DQF_SYS_FILE flag in
> +Q_GETINFO output.
>   This operation requires privilege
>   .RB ( CAP_SYS_ADMIN ).
>   .TP 8
> @@ -638,7 +646,8 @@ The
>   .I id
>   argument is ignored.
>   .TP
> -.B Q_XQUOTARM
> +.B Q_XQUOTARM() " (since Linux 3.16)"
> +.\" 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc
>   Free the disk space taken by disk quotas. The
>   .I addr
>   argument should be a pointer to an
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-31  6:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24  8:11 [PATCH] quotactl.2: Add some details about Q_QUOTAON Yang Xu
2019-10-24  9:55 ` Jan Kara
2019-10-24 10:03   ` Yang Xu
2019-10-25  6:06   ` [PATCH v2] " Yang Xu
2019-10-31  6:04     ` Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).