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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1335383914-19371-1-git-send-email-sasikanth.v19@gmail.com>
Date:	Thu, 26 Apr 2012 01:28:34 +0530
From:	Sasikantha babu <sasikanth.v19@...il.com>
To:	Wu Fengguang <fengguang.wu@...el.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jan Kara <jack@...e.cz>, Curt Wohlgemuth <curtw@...gle.com>,
	Mike Frysinger <vapier@...too.org>,
	Jens Axboe <axboe@...nel.dk>, Rabin Vincent <rabin@....in>
Cc:	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	Sasikantha babu <sasikanth.v19@...il.com>
Subject: [PATCH 1/2] mm: backing-dev - Removed debug_stats entry from backing_dev_info and handled debug fs failue cases

1)  "stats" file part of "bdi->debug_dir" directory we dont have to maintain, especially 
    for removal purpose (directory recursive removal is will do), another dentry for "stats" file
    in backing_dev_info.

2)  Handled failure casess of debug fs entry creation 


Signed-off-by: Sasikantha babu <sasikanth.v19@...il.com>
---
 include/linux/backing-dev.h |    1 -
 mm/backing-dev.c            |   15 ++++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index b1038bd..a9ad582 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -106,7 +106,6 @@ struct backing_dev_info {
 
 #ifdef CONFIG_DEBUG_FS
 	struct dentry *debug_dir;
-	struct dentry *debug_stats;
 #endif
 };
 
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index dd8e2aa..00ee55c 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -136,15 +136,20 @@ static const struct file_operations bdi_debug_stats_fops = {
 
 static void bdi_debug_register(struct backing_dev_info *bdi, const char *name)
 {
-	bdi->debug_dir = debugfs_create_dir(name, bdi_debug_root);
-	bdi->debug_stats = debugfs_create_file("stats", 0444, bdi->debug_dir,
-					       bdi, &bdi_debug_stats_fops);
+	if (bdi_debug_root) {
+
+		bdi->debug_dir = debugfs_create_dir(name, bdi_debug_root);
+
+		if (bdi->debug_dir)
+			debugfs_create_file("stats", 0444, bdi->debug_dir, bdi,
+					    &bdi_debug_stats_fops);
+	}
 }
 
 static void bdi_debug_unregister(struct backing_dev_info *bdi)
 {
-	debugfs_remove(bdi->debug_stats);
-	debugfs_remove(bdi->debug_dir);
+	if (bdi->debug_dir)
+		debugfs_remove_recursive(bdi->debug_dir);
 }
 #else
 static inline void bdi_debug_init(void)
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ