Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit 1545dec

Browse files
committed
Merge tag 'ceph-for-4.15-rc8' of git://github.com/ceph/ceph-client
Pull ceph fixes from Ilya Dryomov: "Two rbd fixes for 4.12 and 4.2 issues respectively, marked for stable" * tag 'ceph-for-4.15-rc8' of git://github.com/ceph/ceph-client: rbd: set max_segments to USHRT_MAX rbd: reacquire lock should update lock owner client id
2 parents ab27815 + 21acdf4 commit 1545dec

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

drivers/block/rbd.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,13 +3047,21 @@ static void format_lock_cookie(struct rbd_device *rbd_dev, char *buf)
30473047
mutex_unlock(&rbd_dev->watch_mutex);
30483048
}
30493049

3050+
static void __rbd_lock(struct rbd_device *rbd_dev, const char *cookie)
3051+
{
3052+
struct rbd_client_id cid = rbd_get_cid(rbd_dev);
3053+
3054+
strcpy(rbd_dev->lock_cookie, cookie);
3055+
rbd_set_owner_cid(rbd_dev, &cid);
3056+
queue_work(rbd_dev->task_wq, &rbd_dev->acquired_lock_work);
3057+
}
3058+
30503059
/*
30513060
* lock_rwsem must be held for write
30523061
*/
30533062
static int rbd_lock(struct rbd_device *rbd_dev)
30543063
{
30553064
struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
3056-
struct rbd_client_id cid = rbd_get_cid(rbd_dev);
30573065
char cookie[32];
30583066
int ret;
30593067

@@ -3068,9 +3076,7 @@ static int rbd_lock(struct rbd_device *rbd_dev)
30683076
return ret;
30693077

30703078
rbd_dev->lock_state = RBD_LOCK_STATE_LOCKED;
3071-
strcpy(rbd_dev->lock_cookie, cookie);
3072-
rbd_set_owner_cid(rbd_dev, &cid);
3073-
queue_work(rbd_dev->task_wq, &rbd_dev->acquired_lock_work);
3079+
__rbd_lock(rbd_dev, cookie);
30743080
return 0;
30753081
}
30763082

@@ -3856,7 +3862,7 @@ static void rbd_reacquire_lock(struct rbd_device *rbd_dev)
38563862
queue_delayed_work(rbd_dev->task_wq,
38573863
&rbd_dev->lock_dwork, 0);
38583864
} else {
3859-
strcpy(rbd_dev->lock_cookie, cookie);
3865+
__rbd_lock(rbd_dev, cookie);
38603866
}
38613867
}
38623868

@@ -4381,7 +4387,7 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
43814387
segment_size = rbd_obj_bytes(&rbd_dev->header);
43824388
blk_queue_max_hw_sectors(q, segment_size / SECTOR_SIZE);
43834389
q->limits.max_sectors = queue_max_hw_sectors(q);
4384-
blk_queue_max_segments(q, segment_size / SECTOR_SIZE);
4390+
blk_queue_max_segments(q, USHRT_MAX);
43854391
blk_queue_max_segment_size(q, segment_size);
43864392
blk_queue_io_min(q, segment_size);
43874393
blk_queue_io_opt(q, segment_size);

0 commit comments

Comments
 (0)