libceph, ceph: change permission for readonly debugfs entries
authorChengguang Xu <cgxu519@icloud.com>
Sat, 10 Feb 2018 06:18:06 +0000 (14:18 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 2 Apr 2018 08:12:45 +0000 (10:12 +0200)
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>
fs/ceph/debugfs.c
net/ceph/debugfs.c

index 644def8137547e103a67e653b9fe3832e0737eb8..abdf98deeec40244693cd731a2d6434d4ebffa09 100644 (file)
@@ -260,7 +260,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
                goto out;
 
        fsc->debugfs_mdsmap = debugfs_create_file("mdsmap",
-                                       0600,
+                                       0400,
                                        fsc->client->debugfs_dir,
                                        fsc,
                                        &mdsmap_show_fops);
@@ -268,7 +268,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
                goto out;
 
        fsc->debugfs_mds_sessions = debugfs_create_file("mds_sessions",
-                                       0600,
+                                       0400,
                                        fsc->client->debugfs_dir,
                                        fsc,
                                        &mds_sessions_show_fops);
@@ -276,7 +276,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
                goto out;
 
        fsc->debugfs_mdsc = debugfs_create_file("mdsc",
-                                               0600,
+                                               0400,
                                                fsc->client->debugfs_dir,
                                                fsc,
                                                &mdsc_show_fops);
@@ -292,7 +292,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
                goto out;
 
        fsc->debugfs_dentry_lru = debugfs_create_file("dentry_lru",
-                                       0600,
+                                       0400,
                                        fsc->client->debugfs_dir,
                                        fsc,
                                        &dentry_lru_show_fops);
index 1eef6806aa1a01e1901f7f57d759a2a52c6cd1df..0ef0f32a4570f98de3ae67a79fe2927d6754db55 100644 (file)
@@ -418,7 +418,7 @@ int ceph_debugfs_client_init(struct ceph_client *client)
                goto out;
 
        client->monc.debugfs_file = debugfs_create_file("monc",
-                                                     0600,
+                                                     0400,
                                                      client->debugfs_dir,
                                                      client,
                                                      &monc_show_fops);
@@ -426,7 +426,7 @@ int ceph_debugfs_client_init(struct ceph_client *client)
                goto out;
 
        client->osdc.debugfs_file = debugfs_create_file("osdc",
-                                                     0600,
+                                                     0400,
                                                      client->debugfs_dir,
                                                      client,
                                                      &osdc_show_fops);
@@ -434,7 +434,7 @@ int ceph_debugfs_client_init(struct ceph_client *client)
                goto out;
 
        client->debugfs_monmap = debugfs_create_file("monmap",
-                                       0600,
+                                       0400,
                                        client->debugfs_dir,
                                        client,
                                        &monmap_show_fops);
@@ -442,7 +442,7 @@ int ceph_debugfs_client_init(struct ceph_client *client)
                goto out;
 
        client->debugfs_osdmap = debugfs_create_file("osdmap",
-                                       0600,
+                                       0400,
                                        client->debugfs_dir,
                                        client,
                                        &osdmap_show_fops);
@@ -450,7 +450,7 @@ int ceph_debugfs_client_init(struct ceph_client *client)
                goto out;
 
        client->debugfs_options = debugfs_create_file("client_options",
-                                       0600,
+                                       0400,
                                        client->debugfs_dir,
                                        client,
                                        &client_options_show_fops);