All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 3/5] tune2fs: do not enable project feature or quota if inode size is 128 bytes
Date: Wed, 23 Aug 2017 11:42:08 -0400	[thread overview]
Message-ID: <20170823154210.8756-3-tytso@mit.edu> (raw)
In-Reply-To: <20170823154210.8756-1-tytso@mit.edu>

Don't allow the user to enable the project feature (or project quota)
if the inode size is 128 bytes.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 misc/tune2fs.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 85435674d..99c17cc47 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1310,6 +1310,11 @@ mmp_error:
 
 	if (FEATURE_ON(E2P_FEATURE_RO_INCOMPAT,
 		       EXT4_FEATURE_RO_COMPAT_PROJECT)) {
+		if (fs->super->s_inode_size == EXT2_GOOD_OLD_INODE_SIZE) {
+			fprintf(stderr, _("Cannot enable project feature; "
+					  "inode size too small.\n"));
+			exit(1);
+		}
 		Q_flag = 1;
 		quota_enable[PRJQUOTA] = QOPT_ENABLE;
 	}
@@ -1497,6 +1502,13 @@ static void handle_quota_options(ext2_filsys fs)
 		/* Nothing to do. */
 		return;
 
+	if (quota_enable[PRJQUOTA] == QOPT_ENABLE &&
+	    fs->super->s_inode_size == EXT2_GOOD_OLD_INODE_SIZE) {
+		fprintf(stderr, _("Cannot enable project quota; "
+				  "inode size too small.\n"));
+		exit(1);
+	}
+
 	for (qtype = 0; qtype < MAXQUOTAS; qtype++) {
 		if (quota_enable[qtype] == QOPT_ENABLE)
 			qtype_bits |= 1 << qtype;
-- 
2.11.0.rc0.7.gbe5a750

  parent reply	other threads:[~2017-08-23 15:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23 15:42 [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Theodore Ts'o
2017-08-23 15:42 ` [PATCH 2/5] mke2fs: automatically use 256 byte inodes if project feature enabled Theodore Ts'o
2017-08-23 15:42 ` Theodore Ts'o [this message]
2017-08-23 15:42 ` [PATCH 4/5] tune2fs: explain why an fsck is needed Theodore Ts'o
2017-08-23 15:42 ` [PATCH 5/5] tune2fs, mke2fs: clarify proceed delay question Theodore Ts'o
2017-08-23 17:17 ` [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Darrick J. Wong

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=20170823154210.8756-3-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.