Blob Blame History Raw
From: Chengguang Xu <cgxu519@icloud.com>
Date: Sat, 10 Feb 2018 14:18:06 +0800
Subject: libceph, ceph: change permission for readonly debugfs entries
Git-commit: 11e1478df91cba4919c2bb011c49f659ebed3d16
Patch-mainline: v4.17-rc1
References: bsc#1089115

Remove write permission for debugfs entries which only have readonly
function.

Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Acked-by: Luis Henriques <lhenriques@suse.com>
---
 fs/ceph/debugfs.c  |    8 ++++----
 net/ceph/debugfs.c |   10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -259,7 +259,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_
 		goto out;
 
 	fsc->debugfs_mdsmap = debugfs_create_file("mdsmap",
-					0600,
+					0400,
 					fsc->client->debugfs_dir,
 					fsc,
 					&mdsmap_show_fops);
@@ -267,7 +267,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_
 		goto out;
 
 	fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions",
-					0600,
+					0400,
 					fsc->client->debugfs_dir,
 					fsc,
 					&mds_sessions_show_fops);
@@ -275,7 +275,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_
 		goto out;
 
 	fsc->debugfs_mdsc = debugfs_create_file("mdsc",
-						0600,
+						0400,
 						fsc->client->debugfs_dir,
 						fsc,
 						&mdsc_show_fops);
@@ -291,7 +291,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_
 		goto out;
 
 	fsc->debugfs_dentry_lru = debugfs_create_file("dentry_lru",
-					0600,
+					0400,
 					fsc->client->debugfs_dir,
 					fsc,
 					&dentry_lru_show_fops);
--- a/net/ceph/debugfs.c
+++ b/net/ceph/debugfs.c
@@ -417,7 +417,7 @@ int ceph_debugfs_client_init(struct ceph
 		goto out;
 
 	client->monc.debugfs_file = debugfs_create_file("monc",
-						      0600,
+						      0400,
 						      client->debugfs_dir,
 						      client,
 						      &monc_show_fops);
@@ -425,7 +425,7 @@ int ceph_debugfs_client_init(struct ceph
 		goto out;
 
 	client->osdc.debugfs_file = debugfs_create_file("osdc",
-						      0600,
+						      0400,
 						      client->debugfs_dir,
 						      client,
 						      &osdc_show_fops);
@@ -433,7 +433,7 @@ int ceph_debugfs_client_init(struct ceph
 		goto out;
 
 	client->debugfs_monmap = debugfs_create_file("monmap",
-					0600,
+					0400,
 					client->debugfs_dir,
 					client,
 					&monmap_show_fops);
@@ -441,7 +441,7 @@ int ceph_debugfs_client_init(struct ceph
 		goto out;
 
 	client->debugfs_osdmap = debugfs_create_file("osdmap",
-					0600,
+					0400,
 					client->debugfs_dir,
 					client,
 					&osdmap_show_fops);
@@ -449,7 +449,7 @@ int ceph_debugfs_client_init(struct ceph
 		goto out;
 
 	client->debugfs_options = debugfs_create_file("client_options",
-					0600,
+					0400,
 					client->debugfs_dir,
 					client,
 					&client_options_show_fops);