Skip to contentSkip to conversation

shmem: Properly report quota mount options

PATCH Applied Jan Kara 3 participants 3 messages Jan 29, 2024 – Feb 20, 2024

Subsystems (2)
lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 shmem: Properly report quota mount options

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")
---
 mm/shmem.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

I've noticed this omission when testing quota-tools support for tmpfs...

mm/shmem.c +18 -0
index d7c84ff62186..30c9dc862505 100644
@@ -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;
 }
 
Signature · 1 line
2.35.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Jan Kara

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")
---
 mm/shmem.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

I've noticed this omission when testing quota-tools support for tmpfs...

mm/shmem.c +10 -0
index d7c84ff62186..30c9dc862505 100644
@@ -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",

mm/shmem.c static int shmem_show_options(struct seq_file *seq, struct dentry *root) · line 4287

Quoted 10 lines
mm/shmem.c +8 -0
+			   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.

Quoted 4 lines
mm/shmem.c +0 -1
--

2.35.3

maintainer Acked-by
#2 lore raw
Quoted 43 lines · Carlos Maiolino
Quoted 29 lines · Jan Kara

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")
---
 mm/shmem.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

I've noticed this omission when testing quota-tools support for tmpfs...

mm/shmem.c +10 -0
index d7c84ff62186..30c9dc862505 100644
@@ -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",

mm/shmem.c static int shmem_show_options(struct seq_file *seq, struct dentry *root) · line 4287

Quoted 10 lines
mm/shmem.c +8 -0
+			   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.

Quoted 1 line

Andrew, you were not on the Cc when Jan posted this, and I have been
dilatory: but please pick it up now for mm-unstable. Original is at
https://lore.kernel.org/linux-mm/[email protected]/
with Carlos' reviewed-by to be appended.

Many thanks for looking after it all while I'm preoccupied (and even when I'm not),
Hugh