Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ceph-for-5.1-rc2' of git://github.com/ceph/ceph-client

Pull ceph fixes from Ilya Dryomov:
"A follow up for the new alloc_size logic and a blacklisting fix,
marked for stable"

* tag 'ceph-for-5.1-rc2' of git://github.com/ceph/ceph-client:
rbd: drop wait_for_latest_osdmap()
libceph: wait for latest osdmap in ceph_monc_blacklist_add()
rbd: set io_min, io_opt and discard_granularity to alloc_size

+34 -23
+6 -22
drivers/block/rbd.c
··· 833 833 pctx->opts->queue_depth = intval; 834 834 break; 835 835 case Opt_alloc_size: 836 - if (intval < 1) { 836 + if (intval < SECTOR_SIZE) { 837 837 pr_err("alloc_size out of range\n"); 838 838 return -EINVAL; 839 839 } ··· 924 924 kref_put(&rbdc->kref, rbd_client_release); 925 925 } 926 926 927 - static int wait_for_latest_osdmap(struct ceph_client *client) 928 - { 929 - u64 newest_epoch; 930 - int ret; 931 - 932 - ret = ceph_monc_get_version(&client->monc, "osdmap", &newest_epoch); 933 - if (ret) 934 - return ret; 935 - 936 - if (client->osdc.osdmap->epoch >= newest_epoch) 937 - return 0; 938 - 939 - ceph_osdc_maybe_request_map(&client->osdc); 940 - return ceph_monc_wait_osdmap(&client->monc, newest_epoch, 941 - client->options->mount_timeout); 942 - } 943 - 944 927 /* 945 928 * Get a ceph client with specific addr and configuration, if one does 946 929 * not exist create it. Either way, ceph_opts is consumed by this ··· 943 960 * Using an existing client. Make sure ->pg_pools is up to 944 961 * date before we look up the pool id in do_rbd_add(). 945 962 */ 946 - ret = wait_for_latest_osdmap(rbdc->client); 963 + ret = ceph_wait_for_latest_osdmap(rbdc->client, 964 + rbdc->client->options->mount_timeout); 947 965 if (ret) { 948 966 rbd_warn(NULL, "failed to get latest osdmap: %d", ret); 949 967 rbd_put_client(rbdc); ··· 4187 4203 q->limits.max_sectors = queue_max_hw_sectors(q); 4188 4204 blk_queue_max_segments(q, USHRT_MAX); 4189 4205 blk_queue_max_segment_size(q, UINT_MAX); 4190 - blk_queue_io_min(q, objset_bytes); 4191 - blk_queue_io_opt(q, objset_bytes); 4206 + blk_queue_io_min(q, rbd_dev->opts->alloc_size); 4207 + blk_queue_io_opt(q, rbd_dev->opts->alloc_size); 4192 4208 4193 4209 if (rbd_dev->opts->trim) { 4194 4210 blk_queue_flag_set(QUEUE_FLAG_DISCARD, q); 4195 - q->limits.discard_granularity = objset_bytes; 4211 + q->limits.discard_granularity = rbd_dev->opts->alloc_size; 4196 4212 blk_queue_max_discard_sectors(q, objset_bytes >> SECTOR_SHIFT); 4197 4213 blk_queue_max_write_zeroes_sectors(q, objset_bytes >> SECTOR_SHIFT); 4198 4214 }
+2
include/linux/ceph/libceph.h
··· 294 294 extern int __ceph_open_session(struct ceph_client *client, 295 295 unsigned long started); 296 296 extern int ceph_open_session(struct ceph_client *client); 297 + int ceph_wait_for_latest_osdmap(struct ceph_client *client, 298 + unsigned long timeout); 297 299 298 300 /* pagevec.c */ 299 301 extern void ceph_release_page_vector(struct page **pages, int num_pages);
+17 -1
net/ceph/ceph_common.c
··· 738 738 } 739 739 EXPORT_SYMBOL(__ceph_open_session); 740 740 741 - 742 741 int ceph_open_session(struct ceph_client *client) 743 742 { 744 743 int ret; ··· 753 754 } 754 755 EXPORT_SYMBOL(ceph_open_session); 755 756 757 + int ceph_wait_for_latest_osdmap(struct ceph_client *client, 758 + unsigned long timeout) 759 + { 760 + u64 newest_epoch; 761 + int ret; 762 + 763 + ret = ceph_monc_get_version(&client->monc, "osdmap", &newest_epoch); 764 + if (ret) 765 + return ret; 766 + 767 + if (client->osdc.osdmap->epoch >= newest_epoch) 768 + return 0; 769 + 770 + ceph_osdc_maybe_request_map(&client->osdc); 771 + return ceph_monc_wait_osdmap(&client->monc, newest_epoch, timeout); 772 + } 773 + EXPORT_SYMBOL(ceph_wait_for_latest_osdmap); 756 774 757 775 static int __init init_ceph_lib(void) 758 776 {
+9
net/ceph/mon_client.c
··· 922 922 mutex_unlock(&monc->mutex); 923 923 924 924 ret = wait_generic_request(req); 925 + if (!ret) 926 + /* 927 + * Make sure we have the osdmap that includes the blacklist 928 + * entry. This is needed to ensure that the OSDs pick up the 929 + * new blacklist before processing any future requests from 930 + * this client. 931 + */ 932 + ret = ceph_wait_for_latest_osdmap(monc->client, 0); 933 + 925 934 out: 926 935 put_generic_request(req); 927 936 return ret;