aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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 /drivers
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 'drivers')
-rw-r--r--drivers/block/rbd.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 191cd177fef2..39c51cc7fabc 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1561,11 +1561,12 @@ rbd_img_obj_request_read_callback(struct rbd_obj_request *obj_request)
1561 obj_request, obj_request->img_request, obj_request->result, 1561 obj_request, obj_request->img_request, obj_request->result,
1562 xferred, length); 1562 xferred, length);
1563 /* 1563 /*
1564 * ENOENT means a hole in the image. We zero-fill the 1564 * ENOENT means a hole in the image. We zero-fill the entire
1565 * entire length of the request. A short read also implies 1565 * length of the request. A short read also implies zero-fill
1566 * zero-fill to the end of the request. Either way we 1566 * to the end of the request. An error requires the whole
1567 * update the xferred count to indicate the whole request 1567 * length of the request to be reported finished with an error
1568 * was satisfied. 1568 * to the block layer. In each case we update the xferred
1569 * count to indicate the whole request was satisfied.
1569 */ 1570 */
1570 rbd_assert(obj_request->type != OBJ_REQUEST_NODATA); 1571 rbd_assert(obj_request->type != OBJ_REQUEST_NODATA);
1571 if (obj_request->result == -ENOENT) { 1572 if (obj_request->result == -ENOENT) {
@@ -1574,14 +1575,13 @@ rbd_img_obj_request_read_callback(struct rbd_obj_request *obj_request)
1574 else 1575 else
1575 zero_pages(obj_request->pages, 0, length); 1576 zero_pages(obj_request->pages, 0, length);
1576 obj_request->result = 0; 1577 obj_request->result = 0;
1577 obj_request->xferred = length;
1578 } else if (xferred < length && !obj_request->result) { 1578 } else if (xferred < length && !obj_request->result) {
1579 if (obj_request->type == OBJ_REQUEST_BIO) 1579 if (obj_request->type == OBJ_REQUEST_BIO)
1580 zero_bio_chain(obj_request->bio_list, xferred); 1580 zero_bio_chain(obj_request->bio_list, xferred);
1581 else 1581 else
1582 zero_pages(obj_request->pages, xferred, length); 1582 zero_pages(obj_request->pages, xferred, length);
1583 obj_request->xferred = length;
1584 } 1583 }
1584 obj_request->xferred = length;
1585 obj_request_done_set(obj_request); 1585 obj_request_done_set(obj_request);
1586} 1586}
1587 1587
@@ -2167,9 +2167,9 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request,
2167 struct rbd_obj_request *obj_request = NULL; 2167 struct rbd_obj_request *obj_request = NULL;
2168 struct rbd_obj_request *next_obj_request; 2168 struct rbd_obj_request *next_obj_request;
2169 bool write_request = img_request_write_test(img_request); 2169 bool write_request = img_request_write_test(img_request);
2170 struct bio *bio_list = 0; 2170 struct bio *bio_list = NULL;
2171 unsigned int bio_offset = 0; 2171 unsigned int bio_offset = 0;
2172 struct page **pages = 0; 2172 struct page **pages = NULL;
2173 u64 img_offset; 2173 u64 img_offset;
2174 u64 resid; 2174 u64 resid;
2175 u16 opcode; 2175 u16 opcode;
@@ -2207,6 +2207,11 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request,
2207 rbd_segment_name_free(object_name); 2207 rbd_segment_name_free(object_name);
2208 if (!obj_request) 2208 if (!obj_request)
2209 goto out_unwind; 2209 goto out_unwind;
2210 /*
2211 * set obj_request->img_request before creating the
2212 * osd_request so that it gets the right snapc
2213 */
2214 rbd_img_obj_request_add(img_request, obj_request);
2210 2215
2211 if (type == OBJ_REQUEST_BIO) { 2216 if (type == OBJ_REQUEST_BIO) {
2212 unsigned int clone_size; 2217 unsigned int clone_size;
@@ -2248,11 +2253,6 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request,
2248 obj_request->pages, length, 2253 obj_request->pages, length,
2249 offset & ~PAGE_MASK, false, false); 2254 offset & ~PAGE_MASK, false, false);
2250 2255
2251 /*
2252 * set obj_request->img_request before formatting
2253 * the osd_request so that it gets the right snapc
2254 */
2255 rbd_img_obj_request_add(img_request, obj_request);
2256 if (write_request) 2256 if (write_request)
2257 rbd_osd_req_format_write(obj_request); 2257 rbd_osd_req_format_write(obj_request);
2258 else 2258 else
@@ -3706,12 +3706,14 @@ static int _rbd_dev_v2_snap_size(struct rbd_device *rbd_dev, u64 snap_id,
3706 if (ret < sizeof (size_buf)) 3706 if (ret < sizeof (size_buf))
3707 return -ERANGE; 3707 return -ERANGE;
3708 3708
3709 if (order) 3709 if (order) {
3710 *order = size_buf.order; 3710 *order = size_buf.order;
3711 dout(" order %u", (unsigned int)*order);
3712 }
3711 *snap_size = le64_to_cpu(size_buf.size); 3713 *snap_size = le64_to_cpu(size_buf.size);
3712 3714
3713 dout(" snap_id 0x%016llx order = %u, snap_size = %llu\n", 3715 dout(" snap_id 0x%016llx snap_size = %llu\n",
3714 (unsigned long long)snap_id, (unsigned int)*order, 3716 (unsigned long long)snap_id,
3715 (unsigned long long)*snap_size); 3717 (unsigned long long)*snap_size);
3716 3718
3717 return 0; 3719 return 0;