diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-22 22:09:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-22 22:09:31 -0400 |
commit | b03fcfaef3538390cfb5e8d268fcdc5c828af1c7 (patch) | |
tree | bcb801c3f464710f4101ddc57f819ea0c3a8a636 /fs | |
parent | e2577d229374efc49f6479f42a54c3bd44a6008d (diff) | |
parent | 717e6f2893eb35ce6728c3cacdc297b78d371b31 (diff) |
Merge tag 'ceph-for-4.14-rc2' of git://github.com/ceph/ceph-client
Pull ceph fixes from Ilya Dryomov:
"Two small but important fixes: RADOS semantic change in upcoming v12.2.1
release and a rare NULL dereference in create_session_open_msg()"
* tag 'ceph-for-4.14-rc2' of git://github.com/ceph/ceph-client:
ceph: avoid panic in create_session_open_msg() if utsname() returns NULL
libceph: don't allow bidirectional swap of pg-upmap-items
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/mds_client.c | 7 | ||||
-rw-r--r-- | fs/ceph/mds_client.h | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 9dd6b836ac9e..84edfc60d87a 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -7,7 +7,6 @@ | |||
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/debugfs.h> | 8 | #include <linux/debugfs.h> |
9 | #include <linux/seq_file.h> | 9 | #include <linux/seq_file.h> |
10 | #include <linux/utsname.h> | ||
11 | #include <linux/ratelimit.h> | 10 | #include <linux/ratelimit.h> |
12 | 11 | ||
13 | #include "super.h" | 12 | #include "super.h" |
@@ -884,8 +883,8 @@ static struct ceph_msg *create_session_open_msg(struct ceph_mds_client *mdsc, u6 | |||
884 | void *p; | 883 | void *p; |
885 | 884 | ||
886 | const char* metadata[][2] = { | 885 | const char* metadata[][2] = { |
887 | {"hostname", utsname()->nodename}, | 886 | {"hostname", mdsc->nodename}, |
888 | {"kernel_version", utsname()->release}, | 887 | {"kernel_version", init_utsname()->release}, |
889 | {"entity_id", opt->name ? : ""}, | 888 | {"entity_id", opt->name ? : ""}, |
890 | {"root", fsopt->server_path ? : "/"}, | 889 | {"root", fsopt->server_path ? : "/"}, |
891 | {NULL, NULL} | 890 | {NULL, NULL} |
@@ -3539,6 +3538,8 @@ int ceph_mdsc_init(struct ceph_fs_client *fsc) | |||
3539 | init_rwsem(&mdsc->pool_perm_rwsem); | 3538 | init_rwsem(&mdsc->pool_perm_rwsem); |
3540 | mdsc->pool_perm_tree = RB_ROOT; | 3539 | mdsc->pool_perm_tree = RB_ROOT; |
3541 | 3540 | ||
3541 | strncpy(mdsc->nodename, utsname()->nodename, | ||
3542 | sizeof(mdsc->nodename) - 1); | ||
3542 | return 0; | 3543 | return 0; |
3543 | } | 3544 | } |
3544 | 3545 | ||
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index db57ae98ed34..636d6b2ec49c 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/rbtree.h> | 8 | #include <linux/rbtree.h> |
9 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
10 | #include <linux/refcount.h> | 10 | #include <linux/refcount.h> |
11 | #include <linux/utsname.h> | ||
11 | 12 | ||
12 | #include <linux/ceph/types.h> | 13 | #include <linux/ceph/types.h> |
13 | #include <linux/ceph/messenger.h> | 14 | #include <linux/ceph/messenger.h> |
@@ -368,6 +369,8 @@ struct ceph_mds_client { | |||
368 | 369 | ||
369 | struct rw_semaphore pool_perm_rwsem; | 370 | struct rw_semaphore pool_perm_rwsem; |
370 | struct rb_root pool_perm_tree; | 371 | struct rb_root pool_perm_tree; |
372 | |||
373 | char nodename[__NEW_UTS_LEN + 1]; | ||
371 | }; | 374 | }; |
372 | 375 | ||
373 | extern const char *ceph_mds_op_name(int op); | 376 | extern const char *ceph_mds_op_name(int op); |