aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-09 12:13:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-09 12:13:22 -0400
commit6cccc7d3012344371a897ecdd1a1398286a6ee8a (patch)
tree64d7c301739abb303e15f108df4c00e8da227caf /net/ceph
parent255ae3fbd298f312ce47ff0c7ee9bb6ad002e0f0 (diff)
parenta8d436f015b627a55ec3b1d15f13d6ab92dd892b (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull ceph updates from Sage Weil: "This includes both the first pile of Ceph patches (which I sent to torvalds@vger, sigh) and a few new patches that add support for fscache for Ceph. That includes a few fscache core fixes that David Howells asked go through the Ceph tree. (Thanks go to Milosz Tanski for putting this feature together) This first batch of patches (included here) had (has) several important RBD bug fixes, hole punch support, several different cleanups in the page cache interactions, improvements in the truncate code (new truncate mutex to avoid shenanigans with i_mutex), and a series of fixes in the synchronous striping read/write code. On top of that is a random collection of small fixes all across the tree (error code checks and error path cleanup, obsolete wq flags, etc)" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (43 commits) ceph: use d_invalidate() to invalidate aliases ceph: remove ceph_lookup_inode() ceph: trivial buildbot warnings fix ceph: Do not do invalidate if the filesystem is mounted nofsc ceph: page still marked private_2 ceph: ceph_readpage_to_fscache didn't check if marked ceph: clean PgPrivate2 on returning from readpages ceph: use fscache as a local presisent cache fscache: Netfs function for cleanup post readpages FS-Cache: Fix heading in documentation CacheFiles: Implement interface to check cache consistency FS-Cache: Add interface to check consistency of a cached object rbd: fix null dereference in dout rbd: fix buffer size for writes to images with snapshots libceph: use pg_num_mask instead of pgp_num_mask for pg.seed calc rbd: fix I/O error propagation for reads ceph: use vfs __set_page_dirty_nobuffers interface instead of doing it inside filesystem ceph: allow sync_read/write return partial successed size of read/write. ceph: fix bugs about handling short-read for sync read mode. ceph: remove useless variable revoked_rdcache ...
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/messenger.c2
-rw-r--r--net/ceph/osd_client.c27
-rw-r--r--net/ceph/osdmap.c2
3 files changed, 20 insertions, 11 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 3be308e14302..4a5df7b1cc9f 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -290,7 +290,7 @@ int ceph_msgr_init(void)
290 if (ceph_msgr_slab_init()) 290 if (ceph_msgr_slab_init())
291 return -ENOMEM; 291 return -ENOMEM;
292 292
293 ceph_msgr_wq = alloc_workqueue("ceph-msgr", WQ_NON_REENTRANT, 0); 293 ceph_msgr_wq = alloc_workqueue("ceph-msgr", 0, 0);
294 if (ceph_msgr_wq) 294 if (ceph_msgr_wq)
295 return 0; 295 return 0;
296 296
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index dd47889adc4a..1606f740d6ae 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -503,7 +503,9 @@ void osd_req_op_extent_init(struct ceph_osd_request *osd_req,
503 struct ceph_osd_req_op *op = _osd_req_op_init(osd_req, which, opcode); 503 struct ceph_osd_req_op *op = _osd_req_op_init(osd_req, which, opcode);
504 size_t payload_len = 0; 504 size_t payload_len = 0;
505 505
506 BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE); 506 BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE &&
507 opcode != CEPH_OSD_OP_DELETE && opcode != CEPH_OSD_OP_ZERO &&
508 opcode != CEPH_OSD_OP_TRUNCATE);
507 509
508 op->extent.offset = offset; 510 op->extent.offset = offset;
509 op->extent.length = length; 511 op->extent.length = length;
@@ -631,6 +633,9 @@ static u64 osd_req_encode_op(struct ceph_osd_request *req,
631 break; 633 break;
632 case CEPH_OSD_OP_READ: 634 case CEPH_OSD_OP_READ:
633 case CEPH_OSD_OP_WRITE: 635 case CEPH_OSD_OP_WRITE:
636 case CEPH_OSD_OP_ZERO:
637 case CEPH_OSD_OP_DELETE:
638 case CEPH_OSD_OP_TRUNCATE:
634 if (src->op == CEPH_OSD_OP_WRITE) 639 if (src->op == CEPH_OSD_OP_WRITE)
635 request_data_len = src->extent.length; 640 request_data_len = src->extent.length;
636 dst->extent.offset = cpu_to_le64(src->extent.offset); 641 dst->extent.offset = cpu_to_le64(src->extent.offset);
@@ -715,7 +720,9 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
715 u64 object_base; 720 u64 object_base;
716 int r; 721 int r;
717 722
718 BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE); 723 BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE &&
724 opcode != CEPH_OSD_OP_DELETE && opcode != CEPH_OSD_OP_ZERO &&
725 opcode != CEPH_OSD_OP_TRUNCATE);
719 726
720 req = ceph_osdc_alloc_request(osdc, snapc, num_ops, use_mempool, 727 req = ceph_osdc_alloc_request(osdc, snapc, num_ops, use_mempool,
721 GFP_NOFS); 728 GFP_NOFS);
@@ -1488,14 +1495,14 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg,
1488 dout("handle_reply %p tid %llu req %p result %d\n", msg, tid, 1495 dout("handle_reply %p tid %llu req %p result %d\n", msg, tid,
1489 req, result); 1496 req, result);
1490 1497
1491 ceph_decode_need(&p, end, 4, bad); 1498 ceph_decode_need(&p, end, 4, bad_put);
1492 numops = ceph_decode_32(&p); 1499 numops = ceph_decode_32(&p);
1493 if (numops > CEPH_OSD_MAX_OP) 1500 if (numops > CEPH_OSD_MAX_OP)
1494 goto bad_put; 1501 goto bad_put;
1495 if (numops != req->r_num_ops) 1502 if (numops != req->r_num_ops)
1496 goto bad_put; 1503 goto bad_put;
1497 payload_len = 0; 1504 payload_len = 0;
1498 ceph_decode_need(&p, end, numops * sizeof(struct ceph_osd_op), bad); 1505 ceph_decode_need(&p, end, numops * sizeof(struct ceph_osd_op), bad_put);
1499 for (i = 0; i < numops; i++) { 1506 for (i = 0; i < numops; i++) {
1500 struct ceph_osd_op *op = p; 1507 struct ceph_osd_op *op = p;
1501 int len; 1508 int len;
@@ -1513,7 +1520,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg,
1513 goto bad_put; 1520 goto bad_put;
1514 } 1521 }
1515 1522
1516 ceph_decode_need(&p, end, 4 + numops * 4, bad); 1523 ceph_decode_need(&p, end, 4 + numops * 4, bad_put);
1517 retry_attempt = ceph_decode_32(&p); 1524 retry_attempt = ceph_decode_32(&p);
1518 for (i = 0; i < numops; i++) 1525 for (i = 0; i < numops; i++)
1519 req->r_reply_op_result[i] = ceph_decode_32(&p); 1526 req->r_reply_op_result[i] = ceph_decode_32(&p);
@@ -1786,6 +1793,8 @@ void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
1786 nr_maps--; 1793 nr_maps--;
1787 } 1794 }
1788 1795
1796 if (!osdc->osdmap)
1797 goto bad;
1789done: 1798done:
1790 downgrade_write(&osdc->map_sem); 1799 downgrade_write(&osdc->map_sem);
1791 ceph_monc_got_osdmap(&osdc->client->monc, osdc->osdmap->epoch); 1800 ceph_monc_got_osdmap(&osdc->client->monc, osdc->osdmap->epoch);
@@ -2129,6 +2138,8 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
2129 dout("osdc_start_request failed map, " 2138 dout("osdc_start_request failed map, "
2130 " will retry %lld\n", req->r_tid); 2139 " will retry %lld\n", req->r_tid);
2131 rc = 0; 2140 rc = 0;
2141 } else {
2142 __unregister_request(osdc, req);
2132 } 2143 }
2133 goto out_unlock; 2144 goto out_unlock;
2134 } 2145 }
@@ -2253,12 +2264,10 @@ int ceph_osdc_init(struct ceph_osd_client *osdc, struct ceph_client *client)
2253 if (err < 0) 2264 if (err < 0)
2254 goto out_msgpool; 2265 goto out_msgpool;
2255 2266
2267 err = -ENOMEM;
2256 osdc->notify_wq = create_singlethread_workqueue("ceph-watch-notify"); 2268 osdc->notify_wq = create_singlethread_workqueue("ceph-watch-notify");
2257 if (IS_ERR(osdc->notify_wq)) { 2269 if (!osdc->notify_wq)
2258 err = PTR_ERR(osdc->notify_wq);
2259 osdc->notify_wq = NULL;
2260 goto out_msgpool; 2270 goto out_msgpool;
2261 }
2262 return 0; 2271 return 0;
2263 2272
2264out_msgpool: 2273out_msgpool:
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
index 603ddd92db19..dbd9a4792427 100644
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -1129,7 +1129,7 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
1129 1129
1130 /* pg_temp? */ 1130 /* pg_temp? */
1131 pgid.seed = ceph_stable_mod(pgid.seed, pool->pg_num, 1131 pgid.seed = ceph_stable_mod(pgid.seed, pool->pg_num,
1132 pool->pgp_num_mask); 1132 pool->pg_num_mask);
1133 pg = __lookup_pg_mapping(&osdmap->pg_temp, pgid); 1133 pg = __lookup_pg_mapping(&osdmap->pg_temp, pgid);
1134 if (pg) { 1134 if (pg) {
1135 *num = pg->len; 1135 *num = pg->len;