Re: [PATCH] shmem: Properly report quota mount options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 29, 2024 at 01:01:31PM +0100, Jan Kara wrote:
> Report quota options among the set of mount options. This allows proper
> user visibility into whether quotas are enabled or not.
> 
> Fixes: e09764cff44b ("shmem: quota support")
> Signed-off-by: Jan Kara <jack@xxxxxxx>
> ---
>  mm/shmem.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> I've noticed this omission when testing quota-tools support for tmpfs...
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index d7c84ff62186..30c9dc862505 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -4265,6 +4265,24 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
>  	mpol_put(mpol);
>  	if (sbinfo->noswap)
>  		seq_printf(seq, ",noswap");
> +#ifdef CONFIG_TMPFS_QUOTA
> +	if (sb_has_quota_active(root->d_sb, USRQUOTA))
> +		seq_printf(seq, ",usrquota");
> +	if (sb_has_quota_active(root->d_sb, GRPQUOTA))
> +		seq_printf(seq, ",grpquota");
> +	if (sbinfo->qlimits.usrquota_bhardlimit)
> +		seq_printf(seq, ",usrquota_block_hardlimit=%lld",
> +			   sbinfo->qlimits.usrquota_bhardlimit);
> +	if (sbinfo->qlimits.grpquota_bhardlimit)
> +		seq_printf(seq, ",grpquota_block_hardlimit=%lld",
> +			   sbinfo->qlimits.grpquota_bhardlimit);
> +	if (sbinfo->qlimits.usrquota_ihardlimit)
> +		seq_printf(seq, ",usrquota_inode_hardlimit=%lld",
> +			   sbinfo->qlimits.usrquota_ihardlimit);
> +	if (sbinfo->qlimits.grpquota_ihardlimit)
> +		seq_printf(seq, ",grpquota_inode_hardlimit=%lld",
> +			   sbinfo->qlimits.grpquota_ihardlimit);
> +#endif
>  	return 0;
>a  }

Looks good, thanks Honza.

Reviewed-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>

> 
> --
> 2.35.3
> 




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux