linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Hugh Dickins <hughd@google.com>
Cc: <linux-mm@kvack.org>, Carlos Maiolino <cem@kernel.org>,
	Jan Kara <jack@suse.cz>
Subject: [PATCH] shmem: Properly report quota mount options
Date: Mon, 29 Jan 2024 13:01:31 +0100	[thread overview]
Message-ID: <20240129120131.21145-1-jack@suse.cz> (raw)

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@suse.cz>
---
 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;
 }
 
-- 
2.35.3



             reply	other threads:[~2024-01-29 12:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <B3mb7-ghi6siV8b3hS5IoZowfCUcLLx6r4421dKPwl7GJmH4tPtdEeIFC2yMyhkEX8Iwy6O_1teb62U2xn_hEA==@protonmail.internalid>
2024-01-29 12:01 ` Jan Kara [this message]
2024-02-05 11:51   ` [PATCH] shmem: Properly report quota mount options Carlos Maiolino
2024-02-20  4:19     ` Hugh Dickins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240129120131.21145-1-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=cem@kernel.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).