Revert "dm: fix dm_blk_report_zones"

This reverts commit f9c1bdf246 which is
commit 37f53a2c60d03743e0eacf7a0c01c279776fef4e upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: I2c68f02b113ceb0e47d458a5cba00a908b805203
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-07-04 11:48:33 +00:00
parent 7a5c39c156
commit 1d7d3adfa4
2 changed files with 8 additions and 18 deletions

View File

@@ -141,7 +141,6 @@ struct mapped_device {
#ifdef CONFIG_BLK_DEV_ZONED
unsigned int nr_zones;
void *zone_revalidate_map;
struct task_struct *revalidate_map_task;
#endif
#ifdef CONFIG_IMA

View File

@@ -56,31 +56,24 @@ int dm_blk_report_zones(struct gendisk *disk, sector_t sector,
{
struct mapped_device *md = disk->private_data;
struct dm_table *map;
struct dm_table *zone_revalidate_map = md->zone_revalidate_map;
int srcu_idx, ret = -EIO;
bool put_table = false;
int srcu_idx, ret;
if (!zone_revalidate_map || md->revalidate_map_task != current) {
/*
* Regular user context or
* Zone revalidation during __bind() is in progress, but this
* call is from a different process
*/
if (!md->zone_revalidate_map) {
/* Regular user context */
if (dm_suspended_md(md))
return -EAGAIN;
map = dm_get_live_table(md, &srcu_idx);
put_table = true;
if (!map)
return -EIO;
} else {
/* Zone revalidation during __bind() */
map = zone_revalidate_map;
map = md->zone_revalidate_map;
}
if (map)
ret = dm_blk_do_report_zones(md, map, sector, nr_zones, cb,
data);
ret = dm_blk_do_report_zones(md, map, sector, nr_zones, cb, data);
if (put_table)
if (!md->zone_revalidate_map)
dm_put_live_table(md, srcu_idx);
return ret;
@@ -182,9 +175,7 @@ int dm_revalidate_zones(struct dm_table *t, struct request_queue *q)
* our table for dm_blk_report_zones() to use directly.
*/
md->zone_revalidate_map = t;
md->revalidate_map_task = current;
ret = blk_revalidate_disk_zones(disk);
md->revalidate_map_task = NULL;
md->zone_revalidate_map = NULL;
if (ret) {