Skip to content

Commit 3b3ce01

Browse files
committed
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()
2 parents 85e97be + 4eacd4c commit 3b3ce01

File tree

6 files changed

+9
-19
lines changed

6 files changed

+9
-19
lines changed

drivers/block/rbd.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3950,6 +3950,7 @@ static void rbd_dev_release(struct device *dev)
39503950
bool need_put = !!rbd_dev->opts;
39513951

39523952
ceph_oid_destroy(&rbd_dev->header_oid);
3953+
ceph_oloc_destroy(&rbd_dev->header_oloc);
39533954

39543955
rbd_put_client(rbd_dev->rbd_client);
39553956
rbd_spec_put(rbd_dev->spec);
@@ -5336,15 +5337,6 @@ static ssize_t do_rbd_add(struct bus_type *bus,
53365337
}
53375338
spec->pool_id = (u64)rc;
53385339

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-
53485340
rbd_dev = rbd_dev_create(rbdc, spec, rbd_opts);
53495341
if (!rbd_dev) {
53505342
rc = -ENOMEM;

fs/ceph/caps.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,9 +1347,12 @@ void ceph_flush_snaps(struct ceph_inode_info *ci,
13471347
{
13481348
struct inode *inode = &ci->vfs_inode;
13491349
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;
13511351
int mds;
1352+
13521353
dout("ceph_flush_snaps %p\n", inode);
1354+
if (psession)
1355+
session = *psession;
13531356
retry:
13541357
spin_lock(&ci->i_ceph_lock);
13551358
if (!(ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS)) {

fs/ceph/mds_client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,6 +2759,7 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap,
27592759
} else {
27602760
path = NULL;
27612761
pathlen = 0;
2762+
pathbase = 0;
27622763
}
27632764

27642765
spin_lock(&ci->i_ceph_lock);

net/ceph/mon_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ static void complete_generic_request(struct ceph_mon_generic_request *req)
574574
put_generic_request(req);
575575
}
576576

577-
void cancel_generic_request(struct ceph_mon_generic_request *req)
577+
static void cancel_generic_request(struct ceph_mon_generic_request *req)
578578
{
579579
struct ceph_mon_client *monc = req->monc;
580580
struct ceph_mon_generic_request *lookup_req;

net/ceph/osd_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4220,7 +4220,7 @@ static struct ceph_msg *alloc_msg_with_page_vector(struct ceph_msg_header *hdr)
42204220

42214221
pages = ceph_alloc_page_vector(calc_pages_for(0, data_len),
42224222
GFP_NOIO);
4223-
if (!pages) {
4223+
if (IS_ERR(pages)) {
42244224
ceph_msg_put(m);
42254225
return NULL;
42264226
}

net/ceph/string_table.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ struct ceph_string *ceph_find_or_create_string(const char* str, size_t len)
8484
}
8585
EXPORT_SYMBOL(ceph_find_or_create_string);
8686

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-
9387
void ceph_release_string(struct kref *ref)
9488
{
9589
struct ceph_string *cs = container_of(ref, struct ceph_string, kref);
@@ -101,7 +95,7 @@ void ceph_release_string(struct kref *ref)
10195
}
10296
spin_unlock(&string_tree_lock);
10397

104-
call_rcu(&cs->rcu, ceph_free_string);
98+
kfree_rcu(cs, rcu);
10599
}
106100
EXPORT_SYMBOL(ceph_release_string);
107101

0 commit comments

Comments
 (0)