lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Sep 2009 15:24:07 +0900
From:	Toshiyuki Okajima <toshi.okajima@...fujitsu.com>
To:	tytso@....edu, akpm@...ux-foundation.org
Cc:	sct@...hat.com, adilger@....com, linux-ext4@...r.kernel.org
Subject: [PATCH 2/3][RFC] ext3: add a message in remount/umount for ext3

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

ext3 doesn't log a record of having unmounted the filesystem. And ext3 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@...fujitsu.com>
---
 fs/ext3/super.c |   32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff -Nurp linux-2.6.31.orig/fs/ext3/super.c linux-2.6.31/fs/ext3/super.c
--- linux-2.6.31.orig/fs/ext3/super.c	2009-09-10 07:13:59.000000000 +0900
+++ linux-2.6.31/fs/ext3/super.c	2009-09-11 17:08:24.742407628 +0900
@@ -328,6 +328,26 @@ void ext3_update_dynamic_rev(struct supe
 	 */
 }
 
+static void ext3_print_mount_message(struct super_block *sb, 
+					int is_remount)
+{
+	printk(KERN_INFO "EXT3 FS %s on %s, ", 
+			is_remount? "remounted": "mounted", sb->s_id);
+	if (EXT3_SB(sb)->s_journal->j_inode == NULL) {
+		char b[BDEVNAME_SIZE];
+
+		printk("external journal on %s\n",
+			bdevname(EXT3_SB(sb)->s_journal->j_dev, b));
+	} else {
+		printk("internal journal\n");
+	}
+}
+
+static void ext3_print_umount_message(struct super_block *sb)
+{
+	printk(KERN_INFO "EXT3 FS unmounted from %s\n", sb->s_id);
+}
+
 /*
  * Open the external journal device
  */
@@ -448,6 +468,7 @@ static void ext3_put_super (struct super
 	sb->s_fs_info = NULL;
 	kfree(sbi->s_blockgroup_lock);
 	kfree(sbi);
+	ext3_print_umount_message(sb);
 
 	unlock_kernel();
 }
@@ -1296,15 +1317,6 @@ static int ext3_setup_super(struct super
 			EXT3_INODES_PER_GROUP(sb),
 			sbi->s_mount_opt);
 
-	printk(KERN_INFO "EXT3 FS on %s, ", sb->s_id);
-	if (EXT3_SB(sb)->s_journal->j_inode == NULL) {
-		char b[BDEVNAME_SIZE];
-
-		printk("external journal on %s\n",
-			bdevname(EXT3_SB(sb)->s_journal->j_dev, b));
-	} else {
-		printk("internal journal\n");
-	}
 	return res;
 }
 
@@ -1972,6 +1984,7 @@ static int ext3_fill_super (struct super
 	}
 
 	ext3_setup_super (sb, es, sb->s_flags & MS_RDONLY);
+	ext3_print_mount_message(sb, 0);
 	/*
 	 * akpm: core read_super() calls in here with the superblock locked.
 	 * That deadlocks, because orphan cleanup needs to lock the superblock
@@ -2599,6 +2612,7 @@ static int ext3_remount (struct super_bl
 		    old_opts.s_qf_names[i] != sbi->s_qf_names[i])
 			kfree(old_opts.s_qf_names[i]);
 #endif
+	ext3_print_mount_message(sb, 1);
 	unlock_super(sb);
 	unlock_kernel();
 	return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ