Merge branch 'stable/for-jens-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into for-linus

Konrad writes:

Please pull in your 'for-linus' branch two little fixes for Xen
block front:

One fix is for handling the XEN_PAGE_SIZE != PAGE_SIZE (4KB vs 64KB
on ARM for example) mishandling while the other is fixing
the accounting for the configuration changes.

+14 -8
+14 -8
drivers/block/xen-blkfront.c
··· 197 /* Number of pages per ring buffer. */ 198 unsigned int nr_ring_pages; 199 struct request_queue *rq; 200 - unsigned int feature_flush; 201 - unsigned int feature_fua; 202 unsigned int feature_discard:1; 203 unsigned int feature_secdiscard:1; 204 unsigned int discard_granularity; 205 unsigned int discard_alignment; 206 - unsigned int feature_persistent:1; 207 /* Number of 4KB segments handled */ 208 unsigned int max_indirect_segments; 209 int is_ready; ··· 2223 } 2224 else 2225 grants = info->max_indirect_segments; 2226 - psegs = grants / GRANTS_PER_PSEG; 2227 2228 err = fill_grant_buffer(rinfo, 2229 (grants + INDIRECT_GREFS(grants)) * BLK_RING_SIZE(info)); ··· 2323 blkfront_setup_discard(info); 2324 2325 info->feature_persistent = 2326 - xenbus_read_unsigned(info->xbdev->otherend, 2327 - "feature-persistent", 0); 2328 2329 indirect_segments = xenbus_read_unsigned(info->xbdev->otherend, 2330 "feature-max-indirect-segments", 0); 2331 - info->max_indirect_segments = min(indirect_segments, 2332 - xen_blkif_max_segments); 2333 } 2334 2335 /* ··· 2654 2655 if (!xen_domain()) 2656 return -ENODEV; 2657 2658 if (xen_blkif_max_ring_order > XENBUS_MAX_RING_GRANT_ORDER) { 2659 pr_info("Invalid max_ring_order (%d), will use default max: %d.\n",
··· 197 /* Number of pages per ring buffer. */ 198 unsigned int nr_ring_pages; 199 struct request_queue *rq; 200 + unsigned int feature_flush:1; 201 + unsigned int feature_fua:1; 202 unsigned int feature_discard:1; 203 unsigned int feature_secdiscard:1; 204 + unsigned int feature_persistent:1; 205 unsigned int discard_granularity; 206 unsigned int discard_alignment; 207 /* Number of 4KB segments handled */ 208 unsigned int max_indirect_segments; 209 int is_ready; ··· 2223 } 2224 else 2225 grants = info->max_indirect_segments; 2226 + psegs = DIV_ROUND_UP(grants, GRANTS_PER_PSEG); 2227 2228 err = fill_grant_buffer(rinfo, 2229 (grants + INDIRECT_GREFS(grants)) * BLK_RING_SIZE(info)); ··· 2323 blkfront_setup_discard(info); 2324 2325 info->feature_persistent = 2326 + !!xenbus_read_unsigned(info->xbdev->otherend, 2327 + "feature-persistent", 0); 2328 2329 indirect_segments = xenbus_read_unsigned(info->xbdev->otherend, 2330 "feature-max-indirect-segments", 0); 2331 + if (indirect_segments > xen_blkif_max_segments) 2332 + indirect_segments = xen_blkif_max_segments; 2333 + if (indirect_segments <= BLKIF_MAX_SEGMENTS_PER_REQUEST) 2334 + indirect_segments = 0; 2335 + info->max_indirect_segments = indirect_segments; 2336 } 2337 2338 /* ··· 2651 2652 if (!xen_domain()) 2653 return -ENODEV; 2654 + 2655 + if (xen_blkif_max_segments < BLKIF_MAX_SEGMENTS_PER_REQUEST) 2656 + xen_blkif_max_segments = BLKIF_MAX_SEGMENTS_PER_REQUEST; 2657 2658 if (xen_blkif_max_ring_order > XENBUS_MAX_RING_GRANT_ORDER) { 2659 pr_info("Invalid max_ring_order (%d), will use default max: %d.\n",