login
Header Space

 
 

Re: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)

Previous thread: none

Next thread: linux-2.6.25: 'mkdir -p' does not work with rootdir as mount point inside a read only filesystem by Lothar Waßmann on Wednesday, April 30, 2008 - 10:50 am. (11 messages)
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Jan Kara <jack@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 11:06 am

In journal=data mode, it is not enough to do write_inode_now as done in
vfs_quota_on() to write all data to their final location (which is needed
for quota_read to work correctly). Calling journal_flush() does its job.

Reported-by: Nick &lt;gentuu@gmail.com&gt;
Cc: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
---
 fs/ext3/super.c |   35 +++++++++++++++++++++++++++--------
 1 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index fe3119a..1c7b0fc 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2759,23 +2759,42 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id,
 
 	if (!test_opt(sb, QUOTA))
 		return -EINVAL;
-	/* Not journalling quota or remount? */
-	if ((!EXT3_SB(sb)-&gt;s_qf_names[USRQUOTA] &amp;&amp;
-	    !EXT3_SB(sb)-&gt;s_qf_names[GRPQUOTA]) || remount)
+	/* When remounting, no checks are needed and in fact, path is NULL */
+	if (remount)
 		return vfs_quota_on(sb, type, format_id, path, remount);
+
 	err = path_lookup(path, LOOKUP_FOLLOW, &amp;nd);
 	if (err)
 		return err;
+
 	/* Quotafile not on the same filesystem? */
 	if (nd.path.mnt-&gt;mnt_sb != sb) {
 		path_put(&amp;nd.path);
 		return -EXDEV;
 	}
-	/* Quotafile not in fs root? */
-	if (nd.path.dentry-&gt;d_parent-&gt;d_inode != sb-&gt;s_root-&gt;d_inode)
-		printk(KERN_WARNING
-			"EXT3-fs: Quota file not on filesystem root. "
-			"Journalled quota will not work.\n");
+	/* Journaling quota? */
+	if (EXT3_SB(sb)-&gt;s_qf_names[type]) {
+		/* Quotafile not of fs root? */
+		if (nd.path.dentry-&gt;d_parent-&gt;d_inode != sb-&gt;s_root-&gt;d_inode)
+			printk(KERN_WARNING
+				"EXT3-fs: Quota file not on filesystem root. "
+				"Journaled quota will not work.\n");
+	}
+
+	/*
+	 * When we journal data on quota file, we have to flush journal to see
+	 * all updates to the file when we bypass pagecache...
+	 */
+	if (ext3_should_journal_data(nd.path.dentry-&gt;d_inode)) {
+		/*
+		 * We don't ...
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Jan Kara <jack@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 11:06 am

In journal=data mode, it is not enough to do write_inode_now as done in
vfs_quota_on() to write all data to their final location (which is needed
for quota_read to work correctly). Calling journal_flush() does its job.

Cc: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
---
 fs/ext4/super.c |   35 +++++++++++++++++++++++++++--------
 1 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 52dd067..f6ab164 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3153,23 +3153,42 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
 
 	if (!test_opt(sb, QUOTA))
 		return -EINVAL;
-	/* Not journalling quota? */
-	if ((!EXT4_SB(sb)-&gt;s_qf_names[USRQUOTA] &amp;&amp;
-	    !EXT4_SB(sb)-&gt;s_qf_names[GRPQUOTA]) || remount)
+	/* When remounting, no checks are needed and in fact, path is NULL */
+	if (remount)
 		return vfs_quota_on(sb, type, format_id, path, remount);
+
 	err = path_lookup(path, LOOKUP_FOLLOW, &amp;nd);
 	if (err)
 		return err;
+
 	/* Quotafile not on the same filesystem? */
 	if (nd.path.mnt-&gt;mnt_sb != sb) {
 		path_put(&amp;nd.path);
 		return -EXDEV;
 	}
-	/* Quotafile not of fs root? */
-	if (nd.path.dentry-&gt;d_parent-&gt;d_inode != sb-&gt;s_root-&gt;d_inode)
-		printk(KERN_WARNING
-			"EXT4-fs: Quota file not on filesystem root. "
-			"Journalled quota will not work.\n");
+	/* Journaling quota? */
+	if (EXT4_SB(sb)-&gt;s_qf_names[type]) {
+		/* Quotafile not of fs root? */
+		if (nd.path.dentry-&gt;d_parent-&gt;d_inode != sb-&gt;s_root-&gt;d_inode)
+			printk(KERN_WARNING
+				"EXT4-fs: Quota file not on filesystem root. "
+				"Journaled quota will not work.\n");
+ 	}
+
+	/*
+	 * When we journal data on quota file, we have to flush journal to see
+	 * all updates to the file when we bypass pagecache...
+	 */
+	if (ext4_should_journal_data(nd.path.dentry-&gt;d_inode)) {
+		/*
+		 * We don't need to lock updates but journal_flush() could
+		 * ...
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Jan Kara <jack@...>, <reiserfs-devel@...>
Date: Wednesday, April 30, 2008 - 11:06 am

In journal=data mode, it is not enough to do write_inode_now() as done in
vfs_quota_on() to write all data to their final location (which is needed for
quota_read to work correctly). Calling journal_end_sync() before calling
vfs_quota_on() does it's job because transactions are committed to the journal
and data marked as dirty in memory so write_inode_now() writes them to their
final locations.

Cc: reiserfs-devel@vger.kernel.org
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
---
 fs/reiserfs/super.c |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index ed424d7..072116a 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -2026,6 +2026,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
 	int err;
 	struct nameidata nd;
 	struct inode *inode;
+	struct reiserfs_transaction_handle th;
 
 	if (!(REISERFS_SB(sb)-&gt;s_mount_opt &amp; (1 &lt;&lt; REISERFS_QUOTA)))
 		return -EINVAL;
@@ -2053,17 +2054,28 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
 		}
 		mark_inode_dirty(inode);
 	}
-	/* Not journalling quota? No more tests needed... */
-	if (!REISERFS_SB(sb)-&gt;s_qf_names[USRQUOTA] &amp;&amp;
-	    !REISERFS_SB(sb)-&gt;s_qf_names[GRPQUOTA]) {
-		path_put(&amp;nd.path);
-		return vfs_quota_on(sb, type, format_id, path, 0);
-	}
-	/* Quotafile not of fs root? */
-	if (nd.path.dentry-&gt;d_parent-&gt;d_inode != sb-&gt;s_root-&gt;d_inode)
-		reiserfs_warning(sb,
+	/* Journaling quota? */
+	if (REISERFS_SB(sb)-&gt;s_qf_names[type]) {
+		/* Quotafile not of fs root? */
+		if (nd.path.dentry-&gt;d_parent-&gt;d_inode != sb-&gt;s_root-&gt;d_inode)
+			reiserfs_warning(sb,
 				 "reiserfs: Quota file not on filesystem root. "
 				 "Journalled quota will not work.");
+	}
+
+	/*
+	 * When we journal data on quota file, we have to flush journal to see
+	 * all updates to the file when we bypass pagecache...
+	 ...
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Jan Kara <jack@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 11:06 am

Cc: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
---
 fs/ext3/super.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 1c7b0fc..890e72f 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -1020,7 +1020,7 @@ static int parse_options (char *options, struct super_block *sb,
 set_qf_name:
 			if (sb_any_quota_enabled(sb)) {
 				printk(KERN_ERR
-					"EXT3-fs: Cannot change journalled "
+					"EXT3-fs: Cannot change journaled "
 					"quota options when quota turned on.\n");
 				return 0;
 			}
@@ -1058,7 +1058,7 @@ set_qf_name:
 clear_qf_name:
 			if (sb_any_quota_enabled(sb)) {
 				printk(KERN_ERR "EXT3-fs: Cannot change "
-					"journalled quota options when "
+					"journaled quota options when "
 					"quota turned on.\n");
 				return 0;
 			}
@@ -1169,14 +1169,14 @@ clear_qf_name:
 		}
 
 		if (!sbi-&gt;s_jquota_fmt) {
-			printk(KERN_ERR "EXT3-fs: journalled quota format "
+			printk(KERN_ERR "EXT3-fs: journaled quota format "
 					"not specified.\n");
 			return 0;
 		}
 	} else {
 		if (sbi-&gt;s_jquota_fmt) {
-			printk(KERN_ERR "EXT3-fs: journalled quota format "
-					"specified with no journalling "
+			printk(KERN_ERR "EXT3-fs: journaled quota format "
+					"specified with no journaling "
 					"enabled.\n");
 			return 0;
 		}
@@ -1370,7 +1370,7 @@ static void ext3_orphan_cleanup (struct super_block * sb,
 			int ret = ext3_quota_on_mount(sb, i);
 			if (ret &lt; 0)
 				printk(KERN_ERR
-					"EXT3-fs: Cannot turn on journalled "
+					"EXT3-fs: Cannot turn on journaled "
 					"quota: error %d\n", ret);
 		}
 	}
@@ -2712,7 +2712,7 @@ static int ext3_release_dquot(struct dquot *dquot)
 
 static int ext3_mark_dquot_dirty(struct dquot *dquot)
 {
-	/* Are we journalling quotas? */
+	/* Are we journaling quotas? */
 	if (EXT3_SB(dquot-&gt;dq_sb)-&gt;s_qf_names[USRQUOTA] ||
 	    EXT3_SB(dquot-&gt;dq_sb)-&gt;s_qf_names[GRPQUOTA]) {
 		d...
To: Jan Kara <jack@...>
Cc: <linux-kernel@...>, <jack@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 1:43 pm

On Wed, 30 Apr 2008 17:06:15 +0200

hrm, who said?

Dictionary.com recognises neither.

google(journalled) = 520,000
google(journaled) = 652,000

akpm:/usr/src/25&gt; grep journalled fs/ext3/*.c|wc -l
17
akpm:/usr/src/25&gt; grep journaled fs/ext3/*.c|wc -l 
6


--
To: Andrew Morton <akpm@...>
Cc: <linux-kernel@...>, <linux-ext4@...>
Date: Monday, May 5, 2008 - 6:09 am

google.cz gives like 250k vs 519k, interesting. Anyway, I'm happy to
leave the decision on the proper spelling of the verb to people with better
English skills ;).

									Honza
-- 
Jan Kara &lt;jack@suse.cz&gt;
SUSE Labs, CR
--
To: Andrew Morton <akpm@...>
Cc: Jan Kara <jack@...>, <linux-kernel@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 4:27 pm

On Wed, 30 Apr 2008 10:43:30 -0700

This has come up several times before so I thought it might be time to
finally dig to the bottom of the pile and end it forever.

I put on my library hat and went for a dig: the verb is in fact "to
journalize", which according to the OED means

"enter (notes or information) in a journal"

Journal itself is strictly a noun. Thus in English it would be correct
for a file system to have a journal (from the latin diurnalis if anyone
cares) but it would appear that it is a journalizing file system.

The American dictionaries appear to agree with this viewpoint.

If we regard "journalizing" as incorrect then the natural way to end the
word would be -lled for British English and -led would certainly sound
and feel wrong. Indeed the search for the OED turns journalled into
journal when guessing near words but refuses to consider journaled. Our
existing policy is not to mess with US v UK v AU v CA v .. spelling
and that is probably wise. 

A search of the ACM literature finds "journalized", "journalled" and
"journaled" are all in use for this operation.

I would submit the correct patch is to change the words to journalizing
and journalized. That would put Linux in agreement with the dictionary,
avoid US v UK meaning differences and not pose a problem linguistically
as all forms are currently in use.

Alan
--
To: Alan Cox <alan@...>
Cc: Andrew Morton <akpm@...>, Jan Kara <jack@...>, <linux-kernel@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 6:02 pm

I hate to get into these discussions, but I've used "journaled" a lot,
so I feel I should chime in.

Maybe it's different in the UK, but I've always understood that if the
accent is not on the last syllable, then you do not double the final
vowel: offer, offered.  So if we accept the use of "journal" as a verb,
"journaled" would be correct.  

Since it's not a real word, I'd be happy not to make a big deal out of

That would probably be more correct, but the use of "journal" as a verb
has really gotten ingrained in file system developers brains.  I
personally haven't heard or used "journalized" and it would take some
getting used to.

Shaggy

P.S. Evolution's spell-checker doesn't like "journalize" either, but I
trust that it's correct.
-- 
David Kleikamp
IBM Linux Technology Center

--
To: Dave Kleikamp <shaggy@...>
Cc: Alan Cox <alan@...>, Andrew Morton <akpm@...>, Jan Kara <jack@...>, <linux-kernel@...>, <linux-ext4@...>
Date: Saturday, May 3, 2008 - 2:32 am

So I have been taught as well.  Merriam-Webster says:

The word you've entered isn't in the dictionary. Click on a spelling
suggestion below or try again using the search bar above.
Suggestions for journalled:
     1. journalese             2. journalized
     3. journalize             4. journals
     5. journalizer            6. journeyed
     7. journal                8. journal box
     9. Journalist            10. julienned
    11. junketed              12. generally
    13. generals              14. journaleses
    15. Journalism            16. General
    17. gillnetted            18. gingered
    19. journalizes           20. gendered

I'd suggest using neither M-W or OED as sole references and accept
spellings from both.  Past experience has shown me that this is one
area where there will *never* be consensus.

-sb
--
To: Dave Kleikamp <shaggy@...>
Cc: Andrew Morton <akpm@...>, Jan Kara <jack@...>, <linux-kernel@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 7:20 pm

I noticed and IBM cannot even agree internally 8)

"Tivoli Storage Manager Journal Based Backup troubleshooting techniques
 and solutions to common problems seen with journalized backups and the
 journal database. This is from a 2005_November_07 Support Technical
 Exchange Web seminar presented by TSM Support staff"


Mandrake use Journalized File System in various press articles. Mac
people seem to like journalized too and google shows it used in various
reviews and articles.

I think I'm going to follow this up with the professional bodies and see
if there is an opinion because either the computing world needs to agree
on a proper English name, or they need to agree on a new one and talk to
the dictionary people about it.


Alan
--
To: Alan Cox <alan@...>, Dave Kleikamp <shaggy@...>
Cc: Andrew Morton <akpm@...>, Jan Kara <jack@...>, <linux-kernel@...>, <linux-ext4@...>
Date: Thursday, May 1, 2008 - 6:01 am

_________________________________________________________________
Windows Live Spaces – your life, your Space. Click here to find out more.
http://get.live.com/spaces/overview--
To: Alan Cox <alan@...>
Cc: Andrew Morton <akpm@...>, Jan Kara <jack@...>, <linux-kernel@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 10:28 pm

If there's some kind of consensus, I don't have strong feelings either
way.
-- 
David Kleikamp
IBM Linux Technology Center

--
To: Dave Kleikamp <shaggy@...>
Cc: Andrew Morton <akpm@...>, Jan Kara <jack@...>, <linux-kernel@...>, <linux-ext4@...>
Date: Thursday, May 1, 2008 - 5:47 am

BCS: "BCS use the OED as the final arbiter, without the zeds though...so
journalise is what we'd use if we absolutely had to."

I don't know if anyone has the right ACM contacts to find out what the
other big professional body thinks ?

Alan
--
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Jan Kara <jack@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 11:06 am

Cc: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
---
 fs/ext4/super.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index f6ab164..49099e4 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1164,7 +1164,7 @@ static int parse_options (char *options, struct super_block *sb,
 set_qf_name:
 			if (sb_any_quota_enabled(sb)) {
 				printk(KERN_ERR
-					"EXT4-fs: Cannot change journalled "
+					"EXT4-fs: Cannot change journaled "
 					"quota options when quota turned on.\n");
 				return 0;
 			}
@@ -1202,7 +1202,7 @@ set_qf_name:
 clear_qf_name:
 			if (sb_any_quota_enabled(sb)) {
 				printk(KERN_ERR "EXT4-fs: Cannot change "
-					"journalled quota options when "
+					"journaled quota options when "
 					"quota turned on.\n");
 				return 0;
 			}
@@ -1248,7 +1248,7 @@ clear_qf_name:
 		case Opt_jqfmt_vfsold:
 		case Opt_jqfmt_vfsv0:
 			printk(KERN_ERR
-				"EXT4-fs: journalled quota options not "
+				"EXT4-fs: journaled quota options not "
 				"supported.\n");
 			break;
 		case Opt_noquota:
@@ -1333,14 +1333,14 @@ clear_qf_name:
 		}
 
 		if (!sbi-&gt;s_jquota_fmt) {
-			printk(KERN_ERR "EXT4-fs: journalled quota format "
+			printk(KERN_ERR "EXT4-fs: journaled quota format "
 					"not specified.\n");
 			return 0;
 		}
 	} else {
 		if (sbi-&gt;s_jquota_fmt) {
-			printk(KERN_ERR "EXT4-fs: journalled quota format "
-					"specified with no journalling "
+			printk(KERN_ERR "EXT4-fs: journaled quota format "
+					"specified with no journaling "
 					"enabled.\n");
 			return 0;
 		}
@@ -1581,7 +1581,7 @@ static void ext4_orphan_cleanup (struct super_block * sb,
 			int ret = ext4_quota_on_mount(sb, i);
 			if (ret &lt; 0)
 				printk(KERN_ERR
-					"EXT4-fs: Cannot turn on journalled "
+					"EXT4-fs: Cannot turn on journaled "
 					"quota: error %d\n", ret);
 		}
 	}
@@ -3106,7 +3106,7 @@ static int ext4_release_dquot(struct dquot *dq...
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Jan Kara <jack@...>, <reiserfs-devel@...>
Date: Wednesday, April 30, 2008 - 11:06 am

Cc: reiserfs-devel@vger.kernel.org
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
---
 fs/reiserfs/super.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 072116a..118b059 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -182,7 +182,7 @@ static int finish_unfinished(struct super_block *s)
 			int ret = reiserfs_quota_on_mount(s, i);
 			if (ret &lt; 0)
 				reiserfs_warning(s,
-						 "reiserfs: cannot turn on journalled quota: error %d",
+						 "reiserfs: cannot turn on journaled quota: error %d",
 						 ret);
 		}
 	}
@@ -994,7 +994,7 @@ static int reiserfs_parse_options(struct super_block *s, char *options,	/* strin
 
 			if (sb_any_quota_enabled(s)) {
 				reiserfs_warning(s,
-						 "reiserfs_parse_options: cannot change journalled quota options when quota turned on.");
+						 "reiserfs_parse_options: cannot change journaled quota options when quota turned on.");
 				return 0;
 			}
 			if (*arg) {	/* Some filename specified? */
@@ -1039,7 +1039,7 @@ static int reiserfs_parse_options(struct super_block *s, char *options,	/* strin
 #else
 		if (c == 'u' || c == 'g' || c == 'f') {
 			reiserfs_warning(s,
-					 "reiserfs_parse_options: journalled quota options not supported.");
+					 "reiserfs_parse_options: journaled quota options not supported.");
 			return 0;
 		}
 #endif
@@ -1050,7 +1050,7 @@ static int reiserfs_parse_options(struct super_block *s, char *options,	/* strin
 	    &amp;&amp; (REISERFS_SB(s)-&gt;s_qf_names[USRQUOTA]
 		|| REISERFS_SB(s)-&gt;s_qf_names[GRPQUOTA])) {
 		reiserfs_warning(s,
-				 "reiserfs_parse_options: journalled quota format not specified.");
+				 "reiserfs_parse_options: journaled quota format not specified.");
 		return 0;
 	}
 	/* This checking is not precise wrt the quota type but for our purposes it is sufficient */
@@ -1980,7 +1980,7 @@ static int reiserfs_release_dquot(struct dquot *dquot)
 
 static int reiserfs_mark_dquot_d...
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Jan Kara <jack@...>
Date: Wednesday, April 30, 2008 - 11:06 am

Note that it cannot be an inline function because we don't have struct
super_block prototype...

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
---
 include/linux/quota.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/quota.h b/include/linux/quota.h
index 52e49dc..dcddfb2 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -347,6 +347,9 @@ struct quota_info {
 	((type) == USRQUOTA ? (sb_dqopt(sb)-&gt;flags &amp; DQUOT_USR_SUSPENDED) : \
 			      (sb_dqopt(sb)-&gt;flags &amp; DQUOT_GRP_SUSPENDED))
 
+#define sb_any_quota_suspended(sb) (sb_has_quota_suspended(sb, USRQUOTA) | \
+				  sb_has_quota_suspended(sb, GRPQUOTA))
+
 int register_quota_format(struct quota_format_type *fmt);
 void unregister_quota_format(struct quota_format_type *fmt);
 
-- 
1.5.2.4

--
To: Jan Kara <jack@...>
Cc: <linux-kernel@...>, <jack@...>
Date: Wednesday, April 30, 2008 - 3:29 pm

On Wed, 30 Apr 2008 17:06:18 +0200



Here's a fun exercise:

	sb = sb_orig;
	sb_any_quota_suspended(sb++);
	printk("%d\n", sb - sb_orig);

afaict this will print 44 or thereabouts.

ho hum.
--
To: Andrew Morton <akpm@...>
Cc: <linux-kernel@...>
Date: Monday, May 5, 2008 - 6:01 am

Well, yes but since fs.h includes quota.h to be able to define struct
super_block (needs at least MAXQUOTAS constant) this is kind of chicken and
egg problem. Splitting quota.h into two files is probably the way to go...
I'll include it to my quotaops.h and quota.h cleanups I'm slowly working
  ;)

								Honza
-- 
Jan Kara &lt;jack@suse.cz&gt;
SUSE Labs, CR
--
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Jan Kara <jack@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 11:06 am

We should not allow user to change quota mount options when quota is just
suspended. I would make mount options and internal quota state inconsistent.
Also we should not allow user to change quota format when quota is turned on.
On the other hand we can just silently ignore when some option is set to the
value it already has (mount does this on remount).

Cc: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
---
 fs/ext3/super.c |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 890e72f..0b6f924 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -842,7 +842,7 @@ static int parse_options (char *options, struct super_block *sb,
 	int data_opt = 0;
 	int option;
 #ifdef CONFIG_QUOTA
-	int qtype;
+	int qtype, qfmt;
 	char *qname;
 #endif
 
@@ -1018,7 +1018,9 @@ static int parse_options (char *options, struct super_block *sb,
 		case Opt_grpjquota:
 			qtype = GRPQUOTA;
 set_qf_name:
-			if (sb_any_quota_enabled(sb)) {
+			if ((sb_any_quota_enabled(sb) ||
+			     sb_any_quota_suspended(sb)) &amp;&amp;
+			    !sbi-&gt;s_qf_names[qtype]) {
 				printk(KERN_ERR
 					"EXT3-fs: Cannot change journaled "
 					"quota options when quota turned on.\n");
@@ -1056,7 +1058,9 @@ set_qf_name:
 		case Opt_offgrpjquota:
 			qtype = GRPQUOTA;
 clear_qf_name:
-			if (sb_any_quota_enabled(sb)) {
+			if ((sb_any_quota_enabled(sb) ||
+			     sb_any_quota_suspended(sb)) &amp;&amp;
+			    sbi-&gt;s_qf_names[qtype]) {
 				printk(KERN_ERR "EXT3-fs: Cannot change "
 					"journaled quota options when "
 					"quota turned on.\n");
@@ -1069,10 +1073,20 @@ clear_qf_name:
 			sbi-&gt;s_qf_names[qtype] = NULL;
 			break;
 		case Opt_jqfmt_vfsold:
-			sbi-&gt;s_jquota_fmt = QFMT_VFS_OLD;
-			break;
+			qfmt = QFMT_VFS_OLD;
+			goto set_qf_format;
 		case Opt_jqfmt_vfsv0:
-			sbi-&gt;s_jquota_fmt = QFMT_VFS_V0;
+			qfmt = QFMT_VFS_V0;
+set_qf_format:
+			if ((sb_any_quot...
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Jan Kara <jack@...>, <linux-ext4@...>
Date: Wednesday, April 30, 2008 - 11:06 am

We should not allow user to change quota mount options when quota is just
suspended. I would make mount options and internal quota state inconsistent.
Also we should not allow user to change quota format when quota is turned on.
On the other hand we can just silently ignore when some option is set to the
value it already has (mount does this on remount).

Cc: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
---
 fs/ext4/super.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 49099e4..4f0588a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -979,7 +979,7 @@ static int parse_options (char *options, struct super_block *sb,
 	int data_opt = 0;
 	int option;
 #ifdef CONFIG_QUOTA
-	int qtype;
+	int qtype, qfmt;
 	char *qname;
 #endif
 
@@ -1162,7 +1162,9 @@ static int parse_options (char *options, struct super_block *sb,
 		case Opt_grpjquota:
 			qtype = GRPQUOTA;
 set_qf_name:
-			if (sb_any_quota_enabled(sb)) {
+			if ((sb_any_quota_enabled(sb) ||
+			     sb_any_quota_suspended(sb)) &amp;&amp;
+			    !sbi-&gt;s_qf_names[qtype]) {
 				printk(KERN_ERR
 					"EXT4-fs: Cannot change journaled "
 					"quota options when quota turned on.\n");
@@ -1200,7 +1202,9 @@ set_qf_name:
 		case Opt_offgrpjquota:
 			qtype = GRPQUOTA;
 clear_qf_name:
-			if (sb_any_quota_enabled(sb)) {
+			if ((sb_any_quota_enabled(sb) ||
+			     sb_any_quota_suspended(sb)) &amp;&amp;
+			    sbi-&gt;s_qf_names[qtype]) {
 				printk(KERN_ERR "EXT4-fs: Cannot change "
 					"journaled quota options when "
 					"quota turned on.\n");
@@ -1213,10 +1217,20 @@ clear_qf_name:
 			sbi-&gt;s_qf_names[qtype] = NULL;
 			break;
 		case Opt_jqfmt_vfsold:
-			sbi-&gt;s_jquota_fmt = QFMT_VFS_OLD;
-			break;
+			qfmt = QFMT_VFS_OLD;
+			goto set_qf_format;
 		case Opt_jqfmt_vfsv0:
-			sbi-&gt;s_jquota_fmt = QFMT_VFS_V0;
+			qfmt = QFMT_VFS_V0;
+set_qf_format:
+			if ((sb_any_quota_e...
To: Andrew Morton <akpm@...>
Cc: LKML <linux-kernel@...>, Jan Kara <jack@...>, <reiserfs-devel@...>
Date: Wednesday, April 30, 2008 - 11:06 am

We should not allow user to change quota mount options when quota is just
suspended. It would make mount options and internal quota state inconsistent.
Also we should not allow user to change quota format when quota is turned on.
On the other hand we can just silently ignore when some option is set to the
value it already has (some mount versions do this on remount). Finally, we should
not discard current quota options if parsing of mount options fails.

Cc: reiserfs-devel@vger.kernel.org
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
---
 fs/reiserfs/super.c |   83 ++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 60 insertions(+), 23 deletions(-)

diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 118b059..2c3aa5f 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -876,7 +876,9 @@ static int reiserfs_parse_options(struct super_block *s, char *options,	/* strin
 				     mount options were selected. */
 				  unsigned long *blocks,	/* strtol-ed from NNN of resize=NNN */
 				  char **jdev_name,
-				  unsigned int *commit_max_age)
+				  unsigned int *commit_max_age,
+				  char **qf_names,
+				  unsigned int *qfmt)
 {
 	int c;
 	char *arg = NULL;
@@ -992,7 +994,9 @@ static int reiserfs_parse_options(struct super_block *s, char *options,	/* strin
 		if (c == 'u' || c == 'g') {
 			int qtype = c == 'u' ? USRQUOTA : GRPQUOTA;
 
-			if (sb_any_quota_enabled(s)) {
+			if ((sb_any_quota_enabled(s) ||
+			     sb_any_quota_suspended(s)) &amp;&amp;
+			    (!*arg != !REISERFS_SB(s)-&gt;s_qf_names[qtype])) {
 				reiserfs_warning(s,
 						 "reiserfs_parse_options: cannot change journaled quota options when quota turned on.");
 				return 0;
@@ -1011,30 +1015,39 @@ static int reiserfs_parse_options(struct super_block *s, char *options,	/* strin
 							 "reiserfs_parse_options: quotafile must be on filesystem root.");
 					return 0;
 				}
-				REISERFS_SB(s)-&gt;s_qf_names[qtype] =
+				qf_names[qtype] =
 				    kmalloc(strlen(arg) + ...
Previous thread: none

Next thread: linux-2.6.25: 'mkdir -p' does not work with rootdir as mount point inside a read only filesystem by Lothar Waßmann on Wednesday, April 30, 2008 - 10:50 am. (11 messages)
speck-geostationary