diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-11 16:53:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-11 16:53:34 -0400 |
commit | 3b3ce01a57ad45d1ea4c63012d6f1e740d151d8d (patch) | |
tree | f633acf16643b9b20426d9a7e85f306f07b0c7fb | |
parent | 85e97be32c6242c98dbbc7a241b4a78c1b93327b (diff) | |
parent | 4eacd4cb3a7c4794688ef4fad5d01f3a532a58e9 (diff) |
Merge tag 'ceph-for-4.8-rc2' of https://github.com/ceph/ceph-client
Pull ceph fixes from Ilya Dryomov:
"A patch for a NULL dereference bug introduced in 4.8-rc1 and a handful
of static checker fixes"
* tag 'ceph-for-4.8-rc2' of https://github.com/ceph/ceph-client:
ceph: initialize pathbase in the !dentry case in encode_caps_cb()
rbd: nuke the 32-bit pool id check
rbd: destroy header_oloc in rbd_dev_release()
ceph: fix null pointer dereference in ceph_flush_snaps()
libceph: using kfree_rcu() to simplify the code
libceph: make cancel_generic_request() static
libceph: fix return value check in alloc_msg_with_page_vector()
-rw-r--r-- | drivers/block/rbd.c | 10 | ||||
-rw-r--r-- | fs/ceph/caps.c | 5 | ||||
-rw-r--r-- | fs/ceph/mds_client.c | 1 | ||||
-rw-r--r-- | net/ceph/mon_client.c | 2 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 2 | ||||
-rw-r--r-- | net/ceph/string_table.c | 8 |
6 files changed, 9 insertions, 19 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 1a04af6d2421..6c6519f6492a 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -3950,6 +3950,7 @@ static void rbd_dev_release(struct device *dev) | |||
3950 | bool need_put = !!rbd_dev->opts; | 3950 | bool need_put = !!rbd_dev->opts; |
3951 | 3951 | ||
3952 | ceph_oid_destroy(&rbd_dev->header_oid); | 3952 | ceph_oid_destroy(&rbd_dev->header_oid); |
3953 | ceph_oloc_destroy(&rbd_dev->header_oloc); | ||
3953 | 3954 | ||
3954 | rbd_put_client(rbd_dev->rbd_client); | 3955 | rbd_put_client(rbd_dev->rbd_client); |
3955 | rbd_spec_put(rbd_dev->spec); | 3956 | rbd_spec_put(rbd_dev->spec); |
@@ -5336,15 +5337,6 @@ static ssize_t do_rbd_add(struct bus_type *bus, | |||
5336 | } | 5337 | } |
5337 | spec->pool_id = (u64)rc; | 5338 | spec->pool_id = (u64)rc; |
5338 | 5339 | ||
5339 | /* The ceph file layout needs to fit pool id in 32 bits */ | ||
5340 | |||
5341 | if (spec->pool_id > (u64)U32_MAX) { | ||
5342 | rbd_warn(NULL, "pool id too large (%llu > %u)", | ||
5343 | (unsigned long long)spec->pool_id, U32_MAX); | ||
5344 | rc = -EIO; | ||
5345 | goto err_out_client; | ||
5346 | } | ||
5347 | |||
5348 | rbd_dev = rbd_dev_create(rbdc, spec, rbd_opts); | 5340 | rbd_dev = rbd_dev_create(rbdc, spec, rbd_opts); |
5349 | if (!rbd_dev) { | 5341 | if (!rbd_dev) { |
5350 | rc = -ENOMEM; | 5342 | rc = -ENOMEM; |
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 99115cae1652..16e6ded0b7f2 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -1347,9 +1347,12 @@ void ceph_flush_snaps(struct ceph_inode_info *ci, | |||
1347 | { | 1347 | { |
1348 | struct inode *inode = &ci->vfs_inode; | 1348 | struct inode *inode = &ci->vfs_inode; |
1349 | struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; | 1349 | struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; |
1350 | struct ceph_mds_session *session = *psession; | 1350 | struct ceph_mds_session *session = NULL; |
1351 | int mds; | 1351 | int mds; |
1352 | |||
1352 | dout("ceph_flush_snaps %p\n", inode); | 1353 | dout("ceph_flush_snaps %p\n", inode); |
1354 | if (psession) | ||
1355 | session = *psession; | ||
1353 | retry: | 1356 | retry: |
1354 | spin_lock(&ci->i_ceph_lock); | 1357 | spin_lock(&ci->i_ceph_lock); |
1355 | if (!(ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS)) { | 1358 | if (!(ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS)) { |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index fa59a85226b2..f72d4ae303b2 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -2759,6 +2759,7 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, | |||
2759 | } else { | 2759 | } else { |
2760 | path = NULL; | 2760 | path = NULL; |
2761 | pathlen = 0; | 2761 | pathlen = 0; |
2762 | pathbase = 0; | ||
2762 | } | 2763 | } |
2763 | 2764 | ||
2764 | spin_lock(&ci->i_ceph_lock); | 2765 | spin_lock(&ci->i_ceph_lock); |
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index c83326c5ba58..ef34a02719d7 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c | |||
@@ -574,7 +574,7 @@ static void complete_generic_request(struct ceph_mon_generic_request *req) | |||
574 | put_generic_request(req); | 574 | put_generic_request(req); |
575 | } | 575 | } |
576 | 576 | ||
577 | void cancel_generic_request(struct ceph_mon_generic_request *req) | 577 | static void cancel_generic_request(struct ceph_mon_generic_request *req) |
578 | { | 578 | { |
579 | struct ceph_mon_client *monc = req->monc; | 579 | struct ceph_mon_client *monc = req->monc; |
580 | struct ceph_mon_generic_request *lookup_req; | 580 | struct ceph_mon_generic_request *lookup_req; |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index b5ec09612ff7..a97e7b506612 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -4220,7 +4220,7 @@ static struct ceph_msg *alloc_msg_with_page_vector(struct ceph_msg_header *hdr) | |||
4220 | 4220 | ||
4221 | pages = ceph_alloc_page_vector(calc_pages_for(0, data_len), | 4221 | pages = ceph_alloc_page_vector(calc_pages_for(0, data_len), |
4222 | GFP_NOIO); | 4222 | GFP_NOIO); |
4223 | if (!pages) { | 4223 | if (IS_ERR(pages)) { |
4224 | ceph_msg_put(m); | 4224 | ceph_msg_put(m); |
4225 | return NULL; | 4225 | return NULL; |
4226 | } | 4226 | } |
diff --git a/net/ceph/string_table.c b/net/ceph/string_table.c index ca53c8319209..22fb96efcf34 100644 --- a/net/ceph/string_table.c +++ b/net/ceph/string_table.c | |||
@@ -84,12 +84,6 @@ retry: | |||
84 | } | 84 | } |
85 | EXPORT_SYMBOL(ceph_find_or_create_string); | 85 | EXPORT_SYMBOL(ceph_find_or_create_string); |
86 | 86 | ||
87 | static void ceph_free_string(struct rcu_head *head) | ||
88 | { | ||
89 | struct ceph_string *cs = container_of(head, struct ceph_string, rcu); | ||
90 | kfree(cs); | ||
91 | } | ||
92 | |||
93 | void ceph_release_string(struct kref *ref) | 87 | void ceph_release_string(struct kref *ref) |
94 | { | 88 | { |
95 | struct ceph_string *cs = container_of(ref, struct ceph_string, kref); | 89 | struct ceph_string *cs = container_of(ref, struct ceph_string, kref); |
@@ -101,7 +95,7 @@ void ceph_release_string(struct kref *ref) | |||
101 | } | 95 | } |
102 | spin_unlock(&string_tree_lock); | 96 | spin_unlock(&string_tree_lock); |
103 | 97 | ||
104 | call_rcu(&cs->rcu, ceph_free_string); | 98 | kfree_rcu(cs, rcu); |
105 | } | 99 | } |
106 | EXPORT_SYMBOL(ceph_release_string); | 100 | EXPORT_SYMBOL(ceph_release_string); |
107 | 101 | ||