linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3][RFC](Repost) ext4: add a message in remount/umount for ext4
@ 2009-09-30  6:49 Toshiyuki Okajima
  2009-09-30 17:22 ` Theodore Tso
  0 siblings, 1 reply; 5+ messages in thread
From: Toshiyuki Okajima @ 2009-09-30  6:49 UTC (permalink / raw)
  To: tytso, akpm, adilger; +Cc: sandeen, linux-ext4

From: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>

ext4 doesn't log a record of having unmounted the filesystem. And ext4 doesn't 
log a record when the filesystem is remounted also with read-only. Therefore 
in the system log, we cannot judge whether or not at the certain time this
filesystem user touches it.
For enterprise users, they often want to know when a certain filesystem is 
mounted/remounted/unmounted.

So, we output the message to the system log when the filesystem is 
remounted/unmounted.

Signed-off-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
---
 fs/ext4/super.c |   30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff -Nurp linux-2.6.31.orig/fs/ext4/super.c linux-2.6.31/fs/ext4/super.c
--- linux-2.6.31.orig/fs/ext4/super.c	2009-09-10 07:13:59.000000000 +0900
+++ linux-2.6.31/fs/ext4/super.c	2009-09-11 17:11:07.000000000 +0900
@@ -508,6 +508,25 @@ void ext4_update_dynamic_rev(struct supe
 	 */
 }
 
+static void ext4_print_mount_message(struct super_block *sb, 
+					int is_remount)
+{
+	if (EXT4_SB(sb)->s_journal) {
+		ext4_msg(sb, KERN_INFO, "%s, %s journal on %s",
+			is_remount? "remounted": "mounted",
+		       EXT4_SB(sb)->s_journal->j_inode ? "internal" :
+		       "external", EXT4_SB(sb)->s_journal->j_devname);
+	} else {
+		ext4_msg(sb, KERN_INFO, "%s, no journal",
+				is_remount? "remounted": "mounted");
+	}
+}
+
+static void ext4_print_umount_message(struct super_block *sb)
+{
+	ext4_msg(sb, KERN_INFO, "unmounted");
+}
+
 /*
  * Open the external journal device
  */
@@ -645,6 +664,7 @@ static void ext4_put_super(struct super_
 	 * Now that we are completely done shutting down the
 	 * superblock, we need to actually destroy the kobject.
 	 */
+	ext4_print_umount_message(sb);
 	unlock_kernel();
 	unlock_super(sb);
 	kobject_put(&sbi->s_kobj);
@@ -1645,14 +1665,6 @@ static int ext4_setup_super(struct super
 			EXT4_BLOCKS_PER_GROUP(sb),
 			EXT4_INODES_PER_GROUP(sb),
 			sbi->s_mount_opt);
-
-	if (EXT4_SB(sb)->s_journal) {
-		ext4_msg(sb, KERN_INFO, "%s journal on %s",
-		       EXT4_SB(sb)->s_journal->j_inode ? "internal" :
-		       "external", EXT4_SB(sb)->s_journal->j_devname);
-	} else {
-		ext4_msg(sb, KERN_INFO, "no journal");
-	}
 	return res;
 }
 
@@ -2806,6 +2818,7 @@ no_journal:
 	}
 
 	ext4_setup_super(sb, es, sb->s_flags & MS_RDONLY);
+	ext4_print_mount_message(sb, 0);
 
 	/* determine the minimum size of new large inodes, if present */
 	if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE) {
@@ -3547,6 +3560,7 @@ static int ext4_remount(struct super_blo
 		    old_opts.s_qf_names[i] != sbi->s_qf_names[i])
 			kfree(old_opts.s_qf_names[i]);
 #endif
+	ext4_print_mount_message(sb, 1);
 	unlock_super(sb);
 	unlock_kernel();
 	return 0;

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

end of thread, other threads:[~2009-10-01  4:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-30  6:49 [PATCH 3/3][RFC](Repost) ext4: add a message in remount/umount for ext4 Toshiyuki Okajima
2009-09-30 17:22 ` Theodore Tso
2009-10-01  3:20   ` Toshiyuki Okajima
2009-10-01  3:55     ` Theodore Tso
2009-10-01  4:32       ` Toshiyuki Okajima

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