linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext3: Fix synchronization of quota files in journal=data mode
@ 2008-04-30 15:06 Jan Kara
  2008-04-30 15:06 ` [PATCH] ext4: " Jan Kara
  0 siblings, 1 reply; 22+ messages in thread
From: Jan Kara @ 2008-04-30 15:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Jan Kara, linux-ext4

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 <gentuu@gmail.com>
Cc: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
---
 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)->s_qf_names[USRQUOTA] &&
-	    !EXT3_SB(sb)->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, &nd);
 	if (err)
 		return err;
+
 	/* Quotafile not on the same filesystem? */
 	if (nd.path.mnt->mnt_sb != sb) {
 		path_put(&nd.path);
 		return -EXDEV;
 	}
-	/* Quotafile not in fs root? */
-	if (nd.path.dentry->d_parent->d_inode != sb->s_root->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)->s_qf_names[type]) {
+		/* Quotafile not of fs root? */
+		if (nd.path.dentry->d_parent->d_inode != sb->s_root->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->d_inode)) {
+		/*
+		 * We don't need to lock updates but journal_flush() could
+		 * otherwise be livelocked...
+		 */
+		journal_lock_updates(EXT3_SB(sb)->s_journal);
+		journal_flush(EXT3_SB(sb)->s_journal);
+		journal_unlock_updates(EXT3_SB(sb)->s_journal);
+	}
+
 	path_put(&nd.path);
 	return vfs_quota_on(sb, type, format_id, path, remount);
 }
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH] ext4: Fix synchronization of quota files in journal=data mode
  2008-04-30 15:06 [PATCH] ext3: Fix synchronization of quota files in journal=data mode Jan Kara
@ 2008-04-30 15:06 ` Jan Kara
  2008-04-30 15:06   ` [PATCH] reiserfs: " Jan Kara
  0 siblings, 1 reply; 22+ messages in thread
From: Jan Kara @ 2008-04-30 15:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Jan Kara, linux-ext4

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 <jack@suse.cz>
---
 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)->s_qf_names[USRQUOTA] &&
-	    !EXT4_SB(sb)->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, &nd);
 	if (err)
 		return err;
+
 	/* Quotafile not on the same filesystem? */
 	if (nd.path.mnt->mnt_sb != sb) {
 		path_put(&nd.path);
 		return -EXDEV;
 	}
-	/* Quotafile not of fs root? */
-	if (nd.path.dentry->d_parent->d_inode != sb->s_root->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)->s_qf_names[type]) {
+		/* Quotafile not of fs root? */
+		if (nd.path.dentry->d_parent->d_inode != sb->s_root->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->d_inode)) {
+		/*
+		 * We don't need to lock updates but journal_flush() could
+		 * otherwise be livelocked...
+		 */
+		jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
+		jbd2_journal_flush(EXT4_SB(sb)->s_journal);
+		jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
+	}
+
 	path_put(&nd.path);
 	return vfs_quota_on(sb, type, format_id, path, remount);
 }
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH] reiserfs: Fix synchronization of quota files in journal=data mode
  2008-04-30 15:06 ` [PATCH] ext4: " Jan Kara
@ 2008-04-30 15:06   ` Jan Kara
  2008-04-30 15:06     ` [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled) Jan Kara
  0 siblings, 1 reply; 22+ messages in thread
From: Jan Kara @ 2008-04-30 15:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Jan Kara, reiserfs-devel

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 <jack@suse.cz>
---
 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)->s_mount_opt & (1 << 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)->s_qf_names[USRQUOTA] &&
-	    !REISERFS_SB(sb)->s_qf_names[GRPQUOTA]) {
-		path_put(&nd.path);
-		return vfs_quota_on(sb, type, format_id, path, 0);
-	}
-	/* Quotafile not of fs root? */
-	if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode)
-		reiserfs_warning(sb,
+	/* Journaling quota? */
+	if (REISERFS_SB(sb)->s_qf_names[type]) {
+		/* Quotafile not of fs root? */
+		if (nd.path.dentry->d_parent->d_inode != sb->s_root->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...
+	 */
+	if (reiserfs_file_data_log(inode)) {
+		/* Just start temporary transaction and finish it */
+		err = journal_begin(&th, sb, 1);
+		if (err)
+			return err;
+		err = journal_end_sync(&th, sb, 1);
+		if (err)
+			return err;
+	}
 	path_put(&nd.path);
 	return vfs_quota_on(sb, type, format_id, path, 0);
 }
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 15:06   ` [PATCH] reiserfs: " Jan Kara
@ 2008-04-30 15:06     ` Jan Kara
  2008-04-30 15:06       ` [PATCH] ext4: " Jan Kara
  2008-04-30 17:43       ` [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled) Andrew Morton
  0 siblings, 2 replies; 22+ messages in thread
From: Jan Kara @ 2008-04-30 15:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Jan Kara, linux-ext4

Cc: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
---
 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->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->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 < 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->dq_sb)->s_qf_names[USRQUOTA] ||
 	    EXT3_SB(dquot->dq_sb)->s_qf_names[GRPQUOTA]) {
 		dquot_mark_dquot_dirty(dquot);
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH] ext4: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 15:06     ` [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled) Jan Kara
@ 2008-04-30 15:06       ` Jan Kara
  2008-04-30 15:06         ` [PATCH] reiserfs: " Jan Kara
  2008-04-30 17:43       ` [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled) Andrew Morton
  1 sibling, 1 reply; 22+ messages in thread
From: Jan Kara @ 2008-04-30 15:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Jan Kara, linux-ext4

Cc: linux-ext4@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
---
 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->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->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 < 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 *dquot)
 
 static int ext4_mark_dquot_dirty(struct dquot *dquot)
 {
-	/* Are we journalling quotas? */
+	/* Are we journaling quotas? */
 	if (EXT4_SB(dquot->dq_sb)->s_qf_names[USRQUOTA] ||
 	    EXT4_SB(dquot->dq_sb)->s_qf_names[GRPQUOTA]) {
 		dquot_mark_dquot_dirty(dquot);
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH] reiserfs: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 15:06       ` [PATCH] ext4: " Jan Kara
@ 2008-04-30 15:06         ` Jan Kara
  2008-04-30 15:06           ` [PATCH] quota: Add a convenience macro for filesystems Jan Kara
  0 siblings, 1 reply; 22+ messages in thread
From: Jan Kara @ 2008-04-30 15:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Jan Kara, reiserfs-devel

Cc: reiserfs-devel@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
---
 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 < 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
 	    && (REISERFS_SB(s)->s_qf_names[USRQUOTA]
 		|| REISERFS_SB(s)->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_dirty(struct dquot *dquot)
 {
-	/* Are we journalling quotas? */
+	/* Are we journaling quotas? */
 	if (REISERFS_SB(dquot->dq_sb)->s_qf_names[USRQUOTA] ||
 	    REISERFS_SB(dquot->dq_sb)->s_qf_names[GRPQUOTA]) {
 		dquot_mark_dquot_dirty(dquot);
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH] quota: Add a convenience macro for filesystems
  2008-04-30 15:06         ` [PATCH] reiserfs: " Jan Kara
@ 2008-04-30 15:06           ` Jan Kara
  2008-04-30 15:06             ` [PATCH] ext3: Correct mount option parsing to detect when quota options can be changed Jan Kara
  2008-04-30 19:29             ` [PATCH] quota: Add a convenience macro for filesystems Andrew Morton
  0 siblings, 2 replies; 22+ messages in thread
From: Jan Kara @ 2008-04-30 15:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Jan Kara

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

Signed-off-by: Jan Kara <jack@suse.cz>
---
 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)->flags & DQUOT_USR_SUSPENDED) : \
 			      (sb_dqopt(sb)->flags & 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


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH] ext3: Correct mount option parsing to detect when quota options can be changed
  2008-04-30 15:06           ` [PATCH] quota: Add a convenience macro for filesystems Jan Kara
@ 2008-04-30 15:06             ` Jan Kara
  2008-04-30 15:06               ` [PATCH] ext4: " Jan Kara
  2008-04-30 19:29             ` [PATCH] quota: Add a convenience macro for filesystems Andrew Morton
  1 sibling, 1 reply; 22+ messages in thread
From: Jan Kara @ 2008-04-30 15:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Jan Kara, linux-ext4

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 <jack@suse.cz>
---
 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)) &&
+			    !sbi->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)) &&
+			    sbi->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->s_qf_names[qtype] = NULL;
 			break;
 		case Opt_jqfmt_vfsold:
-			sbi->s_jquota_fmt = QFMT_VFS_OLD;
-			break;
+			qfmt = QFMT_VFS_OLD;
+			goto set_qf_format;
 		case Opt_jqfmt_vfsv0:
-			sbi->s_jquota_fmt = QFMT_VFS_V0;
+			qfmt = QFMT_VFS_V0;
+set_qf_format:
+			if ((sb_any_quota_enabled(sb) ||
+			     sb_any_quota_suspended(sb)) &&
+			    sbi->s_jquota_fmt != qfmt) {
+				printk(KERN_ERR "EXT3-fs: Cannot change "
+					"journaled quota options when "
+					"quota turned on.\n");
+				return 0;
+			}
+			sbi->s_jquota_fmt = qfmt;
 			break;
 		case Opt_quota:
 		case Opt_usrquota:
@@ -1084,7 +1098,8 @@ clear_qf_name:
 			set_opt(sbi->s_mount_opt, GRPQUOTA);
 			break;
 		case Opt_noquota:
-			if (sb_any_quota_enabled(sb)) {
+			if (sb_any_quota_enabled(sb) ||
+			    sb_any_quota_suspended(sb)) {
 				printk(KERN_ERR "EXT3-fs: Cannot change quota "
 					"options when quota turned on.\n");
 				return 0;
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH] ext4: Correct mount option parsing to detect when quota options can be changed
  2008-04-30 15:06             ` [PATCH] ext3: Correct mount option parsing to detect when quota options can be changed Jan Kara
@ 2008-04-30 15:06               ` Jan Kara
  2008-04-30 15:06                 ` [PATCH] reiserfs: " Jan Kara
  0 siblings, 1 reply; 22+ messages in thread
From: Jan Kara @ 2008-04-30 15:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Jan Kara, linux-ext4

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 <jack@suse.cz>
---
 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)) &&
+			    !sbi->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)) &&
+			    sbi->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->s_qf_names[qtype] = NULL;
 			break;
 		case Opt_jqfmt_vfsold:
-			sbi->s_jquota_fmt = QFMT_VFS_OLD;
-			break;
+			qfmt = QFMT_VFS_OLD;
+			goto set_qf_format;
 		case Opt_jqfmt_vfsv0:
-			sbi->s_jquota_fmt = QFMT_VFS_V0;
+			qfmt = QFMT_VFS_V0;
+set_qf_format:
+			if ((sb_any_quota_enabled(sb) ||
+			     sb_any_quota_suspended(sb)) &&
+			    sbi->s_jquota_fmt != qfmt) {
+				printk(KERN_ERR "EXT4-fs: Cannot change "
+					"journaled quota options when "
+					"quota turned on.\n");
+				return 0;
+			}
+			sbi->s_jquota_fmt = qfmt;
 			break;
 		case Opt_quota:
 		case Opt_usrquota:
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH] reiserfs: Correct mount option parsing to detect when quota options can be changed
  2008-04-30 15:06               ` [PATCH] ext4: " Jan Kara
@ 2008-04-30 15:06                 ` Jan Kara
  0 siblings, 0 replies; 22+ messages in thread
From: Jan Kara @ 2008-04-30 15:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Jan Kara, reiserfs-devel

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 <jack@suse.cz>
---
 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)) &&
+			    (!*arg != !REISERFS_SB(s)->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)->s_qf_names[qtype] =
+				qf_names[qtype] =
 				    kmalloc(strlen(arg) + 1, GFP_KERNEL);
-				if (!REISERFS_SB(s)->s_qf_names[qtype]) {
+				if (!qf_names[qtype]) {
 					reiserfs_warning(s,
 							 "reiserfs_parse_options: not enough memory for storing quotafile name.");
 					return 0;
 				}
-				strcpy(REISERFS_SB(s)->s_qf_names[qtype], arg);
+				strcpy(qf_names[qtype], arg);
 				*mount_options |= 1 << REISERFS_QUOTA;
 			} else {
-				kfree(REISERFS_SB(s)->s_qf_names[qtype]);
-				REISERFS_SB(s)->s_qf_names[qtype] = NULL;
+				if (qf_names[qtype] !=
+				    REISERFS_SB(s)->s_qf_names[qtype])
+					kfree(qf_names[qtype]);
+				qf_names[qtype] = NULL;
 			}
 		}
 		if (c == 'f') {
 			if (!strcmp(arg, "vfsold"))
-				REISERFS_SB(s)->s_jquota_fmt = QFMT_VFS_OLD;
+				*qfmt = QFMT_VFS_OLD;
 			else if (!strcmp(arg, "vfsv0"))
-				REISERFS_SB(s)->s_jquota_fmt = QFMT_VFS_V0;
+				*qfmt = QFMT_VFS_V0;
 			else {
 				reiserfs_warning(s,
 						 "reiserfs_parse_options: unknown quota format specified.");
 				return 0;
 			}
+			if ((sb_any_quota_enabled(s) ||
+			     sb_any_quota_suspended(s)) &&
+			    *qfmt != REISERFS_SB(s)->s_jquota_fmt) {
+				reiserfs_warning(s,
+						 "reiserfs_parse_options: cannot change journaled quota options when quota turned on.");
+				return 0;
+			}
 		}
 #else
 		if (c == 'u' || c == 'g' || c == 'f') {
@@ -1046,9 +1059,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options,	/* strin
 	}
 
 #ifdef CONFIG_QUOTA
-	if (!REISERFS_SB(s)->s_jquota_fmt
-	    && (REISERFS_SB(s)->s_qf_names[USRQUOTA]
-		|| REISERFS_SB(s)->s_qf_names[GRPQUOTA])) {
+	if (!REISERFS_SB(s)->s_jquota_fmt && !*qfmt
+	    && (qf_names[USRQUOTA] || qf_names[GRPQUOTA])) {
 		reiserfs_warning(s,
 				 "reiserfs_parse_options: journaled quota format not specified.");
 		return 0;
@@ -1130,6 +1142,21 @@ static void handle_attrs(struct super_block *s)
 	}
 }
 
+#ifdef CONFIG_QUOTA
+static void handle_quota_files(struct super_block *s, char **qf_names,
+			       unsigned int *qfmt)
+{
+	int i;
+
+	for (i = 0; i < MAXQUOTAS; i++) {
+		if (qf_names[i] != REISERFS_SB(s)->s_qf_names[i])
+			kfree(REISERFS_SB(s)->s_qf_names[i]);
+		REISERFS_SB(s)->s_qf_names[i] = qf_names[i];
+	}
+	REISERFS_SB(s)->s_jquota_fmt = *qfmt;
+}
+#endif
+
 static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
 {
 	struct reiserfs_super_block *rs;
@@ -1141,23 +1168,30 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
 	struct reiserfs_journal *journal = SB_JOURNAL(s);
 	char *new_opts = kstrdup(arg, GFP_KERNEL);
 	int err;
+	char *qf_names[MAXQUOTAS];
+	unsigned int qfmt = 0;
 #ifdef CONFIG_QUOTA
 	int i;
+
+	memcpy(qf_names, REISERFS_SB(s)->s_qf_names, sizeof(qf_names));
 #endif
 
 	rs = SB_DISK_SUPER_BLOCK(s);
 
 	if (!reiserfs_parse_options
-	    (s, arg, &mount_options, &blocks, NULL, &commit_max_age)) {
+	    (s, arg, &mount_options, &blocks, NULL, &commit_max_age,
+	    qf_names, &qfmt)) {
 #ifdef CONFIG_QUOTA
-		for (i = 0; i < MAXQUOTAS; i++) {
-			kfree(REISERFS_SB(s)->s_qf_names[i]);
-			REISERFS_SB(s)->s_qf_names[i] = NULL;
-		}
+		for (i = 0; i < MAXQUOTAS; i++)
+			if (qf_names[i] != REISERFS_SB(s)->s_qf_names[i])
+				kfree(qf_names[i]);
 #endif
 		err = -EINVAL;
 		goto out_err;
 	}
+#ifdef CONFIG_QUOTA
+	handle_quota_files(s, qf_names, &qfmt);
+#endif
 
 	handle_attrs(s);
 
@@ -1570,6 +1604,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
 	char *jdev_name;
 	struct reiserfs_sb_info *sbi;
 	int errval = -EINVAL;
+	char *qf_names[MAXQUOTAS] = {};
+	unsigned int qfmt = 0;
 
 	save_mount_options(s, data);
 
@@ -1597,9 +1633,12 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
 	jdev_name = NULL;
 	if (reiserfs_parse_options
 	    (s, (char *)data, &(sbi->s_mount_opt), &blocks, &jdev_name,
-	     &commit_max_age) == 0) {
+	     &commit_max_age, qf_names, &qfmt) == 0) {
 		goto error;
 	}
+#ifdef CONFIG_QUOTA
+	handle_quota_files(s, qf_names, &qfmt);
+#endif
 
 	if (blocks) {
 		SWARN(silent, s, "jmacd-7: reiserfs_fill_super: resize option "
@@ -1819,7 +1858,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
 
 	return (0);
 
-      error:
+error:
 	if (jinit_done) {	/* kill the commit thread, free journal ram */
 		journal_release_error(NULL, s);
 	}
@@ -1830,10 +1869,8 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
 #ifdef CONFIG_QUOTA
 	{
 		int j;
-		for (j = 0; j < MAXQUOTAS; j++) {
-			kfree(sbi->s_qf_names[j]);
-			sbi->s_qf_names[j] = NULL;
-		}
+		for (j = 0; j < MAXQUOTAS; j++)
+			kfree(qf_names[j]);
 	}
 #endif
 	kfree(sbi);
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 15:06     ` [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled) Jan Kara
  2008-04-30 15:06       ` [PATCH] ext4: " Jan Kara
@ 2008-04-30 17:43       ` Andrew Morton
  2008-04-30 20:27         ` Alan Cox
  2008-05-05 10:09         ` Jan Kara
  1 sibling, 2 replies; 22+ messages in thread
From: Andrew Morton @ 2008-04-30 17:43 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-kernel, jack, linux-ext4

On Wed, 30 Apr 2008 17:06:15 +0200
Jan Kara <jack@suse.cz> wrote:

> -					"EXT3-fs: Cannot change journalled "
> +					"EXT3-fs: Cannot change journaled "

hrm, who said?

Dictionary.com recognises neither.

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

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



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] quota: Add a convenience macro for filesystems
  2008-04-30 15:06           ` [PATCH] quota: Add a convenience macro for filesystems Jan Kara
  2008-04-30 15:06             ` [PATCH] ext3: Correct mount option parsing to detect when quota options can be changed Jan Kara
@ 2008-04-30 19:29             ` Andrew Morton
  2008-05-05 10:01               ` Jan Kara
  1 sibling, 1 reply; 22+ messages in thread
From: Andrew Morton @ 2008-04-30 19:29 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-kernel, jack

On Wed, 30 Apr 2008 17:06:18 +0200
Jan Kara <jack@suse.cz> wrote:

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

lame excuse ;)

> ---
>  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)->flags & DQUOT_USR_SUSPENDED) : \
>  			      (sb_dqopt(sb)->flags & 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);


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.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 17:43       ` [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled) Andrew Morton
@ 2008-04-30 20:27         ` Alan Cox
  2008-04-30 22:02           ` Dave Kleikamp
  2008-05-05 10:09         ` Jan Kara
  1 sibling, 1 reply; 22+ messages in thread
From: Alan Cox @ 2008-04-30 20:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jan Kara, linux-kernel, linux-ext4

On Wed, 30 Apr 2008 10:43:30 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Wed, 30 Apr 2008 17:06:15 +0200
> Jan Kara <jack@suse.cz> wrote:
> 
> > -					"EXT3-fs: Cannot change journalled "
> > +					"EXT3-fs: Cannot change journaled "
> 
> hrm, who said?

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 20:27         ` Alan Cox
@ 2008-04-30 22:02           ` Dave Kleikamp
  2008-04-30 23:20             ` Alan Cox
  2008-05-03  6:32             ` SL Baur
  0 siblings, 2 replies; 22+ messages in thread
From: Dave Kleikamp @ 2008-04-30 22:02 UTC (permalink / raw)
  To: Alan Cox; +Cc: Andrew Morton, Jan Kara, linux-kernel, linux-ext4


On Wed, 2008-04-30 at 21:27 +0100, Alan Cox wrote:
> On Wed, 30 Apr 2008 10:43:30 -0700
> Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > On Wed, 30 Apr 2008 17:06:15 +0200
> > Jan Kara <jack@suse.cz> wrote:
> > 
> > > -					"EXT3-fs: Cannot change journalled "
> > > +					"EXT3-fs: Cannot change journaled "
> > 
> > hrm, who said?
> 
> 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 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
it and accept either, so I think we're in agreement.

> 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.

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 22:02           ` Dave Kleikamp
@ 2008-04-30 23:20             ` Alan Cox
  2008-05-01  2:28               ` Dave Kleikamp
  2008-05-01 10:01               ` Joe Fegan
  2008-05-03  6:32             ` SL Baur
  1 sibling, 2 replies; 22+ messages in thread
From: Alan Cox @ 2008-04-30 23:20 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: Andrew Morton, Jan Kara, linux-kernel, linux-ext4

> > A search of the ACM literature finds "journalized", "journalled" and
> > "journaled" are all in use for this operation.
> 
> I hate to get into these discussions, but I've used "journaled" a lot,
> so I feel I should chime in.

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"

"IBM Journaled File System (JFS)"


> 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.

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 23:20             ` Alan Cox
@ 2008-05-01  2:28               ` Dave Kleikamp
  2008-05-01  9:47                 ` Alan Cox
  2008-05-01 10:01               ` Joe Fegan
  1 sibling, 1 reply; 22+ messages in thread
From: Dave Kleikamp @ 2008-05-01  2:28 UTC (permalink / raw)
  To: Alan Cox; +Cc: Andrew Morton, Jan Kara, linux-kernel, linux-ext4


On Thu, 2008-05-01 at 00:20 +0100, Alan Cox wrote:
> > > A search of the ACM literature finds "journalized", "journalled" and
> > > "journaled" are all in use for this operation.
> > 
> > I hate to get into these discussions, but I've used "journaled" a lot,
> > so I feel I should chime in.
> 
> 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"
> 
> "IBM Journaled File System (JFS)"

IBM's big.  What can I say?  :-)

> > 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.
> 
> 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 guess it's more common that I thought.

> 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.

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
  2008-05-01  2:28               ` Dave Kleikamp
@ 2008-05-01  9:47                 ` Alan Cox
  0 siblings, 0 replies; 22+ messages in thread
From: Alan Cox @ 2008-05-01  9:47 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: Andrew Morton, Jan Kara, linux-kernel, linux-ext4

> > 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.
> 
> If there's some kind of consensus, I don't have strong feelings either
> way.

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 23:20             ` Alan Cox
  2008-05-01  2:28               ` Dave Kleikamp
@ 2008-05-01 10:01               ` Joe Fegan
  1 sibling, 0 replies; 22+ messages in thread
From: Joe Fegan @ 2008-05-01 10:01 UTC (permalink / raw)
  To: Alan Cox, Dave Kleikamp; +Cc: Andrew Morton, Jan Kara, linux-kernel, linux-ext4


Then again, I would consider journalize to be the US version of journalise

> Date: Thu, 1 May 2008 00:20:18 +0100
> From: alan@lxorguk.ukuu.org.uk
> To: shaggy@linux.vnet.ibm.com
> CC: akpm@linux-foundation.org; jack@suse.cz; linux-kernel@vger.kernel.org; linux-ext4@vger.kernel.org
> Subject: Re: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
>
>>> A search of the ACM literature finds "journalized", "journalled" and
>>> "journaled" are all in use for this operation.
>>
>> I hate to get into these discussions, but I've used "journaled" a lot,
>> so I feel I should chime in.
>
> 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"
>
> "IBM Journaled File System (JFS)"
>
>
>> 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.
>
> 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 unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html

_________________________________________________________________
Windows Live Spaces – your life, your Space. Click here to find out more.
http://get.live.com/spaces/overview

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 22:02           ` Dave Kleikamp
  2008-04-30 23:20             ` Alan Cox
@ 2008-05-03  6:32             ` SL Baur
  1 sibling, 0 replies; 22+ messages in thread
From: SL Baur @ 2008-05-03  6:32 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: Alan Cox, Andrew Morton, Jan Kara, linux-kernel, linux-ext4

On 4/30/08, Dave Kleikamp <shaggy@linux.vnet.ibm.com> wrote:

> 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.

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] quota: Add a convenience macro for filesystems
  2008-04-30 19:29             ` [PATCH] quota: Add a convenience macro for filesystems Andrew Morton
@ 2008-05-05 10:01               ` Jan Kara
  0 siblings, 0 replies; 22+ messages in thread
From: Jan Kara @ 2008-05-05 10:01 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

On Wed 30-04-08 12:29:11, Andrew Morton wrote:
> On Wed, 30 Apr 2008 17:06:18 +0200
> Jan Kara <jack@suse.cz> wrote:
> 
> > Note that it cannot be an inline function because we don't have struct
> > super_block prototype...
> > 
> 
> lame excuse ;)
  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
on.

> > ---
> >  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)->flags & DQUOT_USR_SUSPENDED) : \
> >  			      (sb_dqopt(sb)->flags & 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);
> 
> 
> 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.
  ;)

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled)
  2008-04-30 17:43       ` [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled) Andrew Morton
  2008-04-30 20:27         ` Alan Cox
@ 2008-05-05 10:09         ` Jan Kara
  1 sibling, 0 replies; 22+ messages in thread
From: Jan Kara @ 2008-05-05 10:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-ext4

On Wed 30-04-08 10:43:30, Andrew Morton wrote:
> On Wed, 30 Apr 2008 17:06:15 +0200
> Jan Kara <jack@suse.cz> wrote:
> 
> > -					"EXT3-fs: Cannot change journalled "
> > +					"EXT3-fs: Cannot change journaled "
> 
> hrm, who said?
> 
> Dictionary.com recognises neither.
> 
> google(journalled) = 520,000
> google(journaled) = 652,000
  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 <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH] reiserfs: Fix synchronization of quota files in journal=data mode
@ 2008-04-29 10:00 Jan Kara
  0 siblings, 0 replies; 22+ messages in thread
From: Jan Kara @ 2008-04-29 10:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, reiserfs-devel, Jan Kara

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.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 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 1dfbc7d..0ca04f2 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)->s_mount_opt & (1 << REISERFS_QUOTA)))
 		return -EINVAL;
@@ -2050,17 +2051,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)->s_qf_names[USRQUOTA] &&
-	    !REISERFS_SB(sb)->s_qf_names[GRPQUOTA]) {
-		path_put(&nd.path);
-		return vfs_quota_on(sb, type, format_id, path);
-	}
-	/* Quotafile not of fs root? */
-	if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode)
-		reiserfs_warning(sb,
+	/* Journaling quota? */
+	if (REISERFS_SB(sb)->s_qf_names[type]) {
+		/* Quotafile not of fs root? */
+		if (nd.path.dentry->d_parent->d_inode != sb->s_root->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...
+	 */
+	if (reiserfs_file_data_log(inode)) {
+		/* Just start temporary transaction and finish it */
+		err = journal_begin(&th, sb, 1);
+		if (err)
+			return err;
+		err = journal_end_sync(&th, sb, 1);
+		if (err)
+			return err;
+	}
 	path_put(&nd.path);
 	return vfs_quota_on(sb, type, format_id, path);
 }
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2008-05-05 10:09 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-30 15:06 [PATCH] ext3: Fix synchronization of quota files in journal=data mode Jan Kara
2008-04-30 15:06 ` [PATCH] ext4: " Jan Kara
2008-04-30 15:06   ` [PATCH] reiserfs: " Jan Kara
2008-04-30 15:06     ` [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled) Jan Kara
2008-04-30 15:06       ` [PATCH] ext4: " Jan Kara
2008-04-30 15:06         ` [PATCH] reiserfs: " Jan Kara
2008-04-30 15:06           ` [PATCH] quota: Add a convenience macro for filesystems Jan Kara
2008-04-30 15:06             ` [PATCH] ext3: Correct mount option parsing to detect when quota options can be changed Jan Kara
2008-04-30 15:06               ` [PATCH] ext4: " Jan Kara
2008-04-30 15:06                 ` [PATCH] reiserfs: " Jan Kara
2008-04-30 19:29             ` [PATCH] quota: Add a convenience macro for filesystems Andrew Morton
2008-05-05 10:01               ` Jan Kara
2008-04-30 17:43       ` [PATCH] ext3: Fix typos in messages and comments (journalled -> journaled) Andrew Morton
2008-04-30 20:27         ` Alan Cox
2008-04-30 22:02           ` Dave Kleikamp
2008-04-30 23:20             ` Alan Cox
2008-05-01  2:28               ` Dave Kleikamp
2008-05-01  9:47                 ` Alan Cox
2008-05-01 10:01               ` Joe Fegan
2008-05-03  6:32             ` SL Baur
2008-05-05 10:09         ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2008-04-29 10:00 [PATCH] reiserfs: Fix synchronization of quota files in journal=data mode Jan Kara

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).