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.

Revert "s390/dasd: Add discard support for ESE volumes"

This reverts commit 7e64db1597fe114b83fe17d0ba96c6aa5fca419a.

The thin provisioning feature introduces an IOCTL and the discard support
to allow userspace tools and filesystems to release unused and previously
allocated space respectively.

During some internal performance improvements and further tests, the
release of allocated space revealed some issues that may lead to data
corruption in some configurations when filesystems are mounted with
discard support enabled.

While we're working on a fix and trying to clarify the situation,
this commit reverts the discard support for ESE volumes to prevent
potential data corruption.

Cc: <stable@vger.kernel.org> # 5.3
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Stefan Haberland and committed by
Jens Axboe
964ce509 dd454839

+3 -54
+3 -54
drivers/s390/block/dasd_eckd.c
··· 2055 2055 if (readonly) 2056 2056 set_bit(DASD_FLAG_DEVICE_RO, &device->flags); 2057 2057 2058 - if (dasd_eckd_is_ese(device)) 2059 - dasd_set_feature(device->cdev, DASD_FEATURE_DISCARD, 1); 2060 - 2061 2058 dev_info(&device->cdev->dev, "New DASD %04X/%02X (CU %04X/%02X) " 2062 2059 "with %d cylinders, %d heads, %d sectors%s\n", 2063 2060 private->rdc_data.dev_type, ··· 3688 3691 return -EINVAL; 3689 3692 } 3690 3693 3691 - static struct dasd_ccw_req * 3692 - dasd_eckd_build_cp_discard(struct dasd_device *device, struct dasd_block *block, 3693 - struct request *req, sector_t first_trk, 3694 - sector_t last_trk) 3695 - { 3696 - return dasd_eckd_dso_ras(device, block, req, first_trk, last_trk, 1); 3697 - } 3698 - 3699 3694 static struct dasd_ccw_req *dasd_eckd_build_cp_cmd_single( 3700 3695 struct dasd_device *startdev, 3701 3696 struct dasd_block *block, ··· 4432 4443 cmdwtd = private->features.feature[12] & 0x40; 4433 4444 use_prefix = private->features.feature[8] & 0x01; 4434 4445 4435 - if (req_op(req) == REQ_OP_DISCARD) 4436 - return dasd_eckd_build_cp_discard(startdev, block, req, 4437 - first_trk, last_trk); 4438 - 4439 4446 cqr = NULL; 4440 4447 if (cdlspecial || dasd_page_cache) { 4441 4448 /* do nothing, just fall through to the cmd mode single case */ ··· 4710 4725 struct dasd_block *block, 4711 4726 struct request *req) 4712 4727 { 4713 - struct dasd_device *startdev = NULL; 4714 4728 struct dasd_eckd_private *private; 4715 - struct dasd_ccw_req *cqr; 4729 + struct dasd_device *startdev; 4716 4730 unsigned long flags; 4731 + struct dasd_ccw_req *cqr; 4717 4732 4718 - /* Discard requests can only be processed on base devices */ 4719 - if (req_op(req) != REQ_OP_DISCARD) 4720 - startdev = dasd_alias_get_start_dev(base); 4733 + startdev = dasd_alias_get_start_dev(base); 4721 4734 if (!startdev) 4722 4735 startdev = base; 4723 4736 private = startdev->private; ··· 6496 6513 unsigned int logical_block_size = block->bp_block; 6497 6514 struct request_queue *q = block->request_queue; 6498 6515 struct dasd_device *device = block->base; 6499 - struct dasd_eckd_private *private; 6500 - unsigned int max_discard_sectors; 6501 - unsigned int max_bytes; 6502 - unsigned int ext_bytes; /* Extent Size in Bytes */ 6503 - int recs_per_trk; 6504 - int trks_per_cyl; 6505 - int ext_limit; 6506 - int ext_size; /* Extent Size in Cylinders */ 6507 6516 int max; 6508 - 6509 - private = device->private; 6510 - trks_per_cyl = private->rdc_data.trk_per_cyl; 6511 - recs_per_trk = recs_per_track(&private->rdc_data, 0, logical_block_size); 6512 6517 6513 6518 if (device->features & DASD_FEATURE_USERAW) { 6514 6519 /* ··· 6518 6547 /* With page sized segments each segment can be translated into one idaw/tidaw */ 6519 6548 blk_queue_max_segment_size(q, PAGE_SIZE); 6520 6549 blk_queue_segment_boundary(q, PAGE_SIZE - 1); 6521 - 6522 - if (dasd_eckd_is_ese(device)) { 6523 - /* 6524 - * Depending on the extent size, up to UINT_MAX bytes can be 6525 - * accepted. However, neither DASD_ECKD_RAS_EXTS_MAX nor the 6526 - * device limits should be exceeded. 6527 - */ 6528 - ext_size = dasd_eckd_ext_size(device); 6529 - ext_limit = min(private->real_cyl / ext_size, DASD_ECKD_RAS_EXTS_MAX); 6530 - ext_bytes = ext_size * trks_per_cyl * recs_per_trk * 6531 - logical_block_size; 6532 - max_bytes = UINT_MAX - (UINT_MAX % ext_bytes); 6533 - if (max_bytes / ext_bytes > ext_limit) 6534 - max_bytes = ext_bytes * ext_limit; 6535 - 6536 - max_discard_sectors = max_bytes / 512; 6537 - 6538 - blk_queue_max_discard_sectors(q, max_discard_sectors); 6539 - blk_queue_flag_set(QUEUE_FLAG_DISCARD, q); 6540 - q->limits.discard_granularity = ext_bytes; 6541 - q->limits.discard_alignment = ext_bytes; 6542 - } 6543 6550 } 6544 6551 6545 6552 static struct ccw_driver dasd_eckd_driver = {