block-6.14-20250214
-----BEGIN PGP SIGNATURE----- iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmevfDEQHGF4Ym9lQGtl cm5lbC5kawAKCRD301j7KXHgptaHEACEqo12wWNcYklms/oy9DxsVEFM7d5waYRR NZy1+i3wbUAGfYl0marBh484kDr7Uyko4YJa0O0LyMKdW7wZOEk36MRUU2+7FeSp 4bFiFlSGyds9kIqjem4dR0ACCL/NW+PS5T79Xh1PnWDEByMH7wbRtPWVT6JJl4r6 PVdi4FB1aV6+C2DayjKbFqR0kDbFnl8INaGw8mg5PpI32A9mCQtl6XU2G/Pw8WVZ 3UJR+DWzfK/lSeVvPiZgOvLHWzi1UB0rKKuWjzbIq7dTtMy241Tox0YRnLsPiNxR ncRHftgEIjgkHjpCT4qQZ/joQfLop6MSkRixWUaORjTRqHHTqhLpj5SzjNlfn0Cb qhb/jf4VoBYD/04NEwvBzNmwyX6xohD07boM2SlnpiPNzBo0pcHzD4YuYzmsUCO4 gE2DeI9NAtDLMB5987Heb2zbvNtWgSM4g9t5zZuKtBEfNPnQwzYKFWeOIbSxmcbN Y5FW+sLXmXLT+li17BeJFzOXp882Lp4oZtSdX1ibTkmdj4P/IcNYuB3Z/VYvF1NO ZY2mBFRdUrii5oBh7iVSkwGIJM/TUwBgjoPlG84F7CoaxK6wQDHovFhkLHUVd7mx JfzTDfbsC/7R934IgLcLDR8uCaLmbMnJNYJqdvGQdR2NVy4azM52zopkHX6ereby DqicWc+Ekg== =zguJ -----END PGP SIGNATURE----- Merge tag 'block-6.14-20250214' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - Fix for request rejection for batch addition - Fix a few issues for bogus mac partition tables * tag 'block-6.14-20250214' of git://git.kernel.dk/linux: partitions: mac: fix handling of bogus partition table block: cleanup and fix batch completion adding conditions
This commit is contained in:
commit
1b8c8cdad1
2 changed files with 29 additions and 7 deletions
|
@ -53,13 +53,25 @@ int mac_partition(struct parsed_partitions *state)
|
|||
}
|
||||
secsize = be16_to_cpu(md->block_size);
|
||||
put_dev_sector(sect);
|
||||
|
||||
/*
|
||||
* If the "block size" is not a power of 2, things get weird - we might
|
||||
* end up with a partition straddling a sector boundary, so we wouldn't
|
||||
* be able to read a partition entry with read_part_sector().
|
||||
* Real block sizes are probably (?) powers of two, so just require
|
||||
* that.
|
||||
*/
|
||||
if (!is_power_of_2(secsize))
|
||||
return -1;
|
||||
datasize = round_down(secsize, 512);
|
||||
data = read_part_sector(state, datasize / 512, §);
|
||||
if (!data)
|
||||
return -1;
|
||||
partoffset = secsize % 512;
|
||||
if (partoffset + sizeof(*part) > datasize)
|
||||
if (partoffset + sizeof(*part) > datasize) {
|
||||
put_dev_sector(sect);
|
||||
return -1;
|
||||
}
|
||||
part = (struct mac_partition *) (data + partoffset);
|
||||
if (be16_to_cpu(part->signature) != MAC_PARTITION_MAGIC) {
|
||||
put_dev_sector(sect);
|
||||
|
@ -112,8 +124,8 @@ int mac_partition(struct parsed_partitions *state)
|
|||
int i, l;
|
||||
|
||||
goodness++;
|
||||
l = strlen(part->name);
|
||||
if (strcmp(part->name, "/") == 0)
|
||||
l = strnlen(part->name, sizeof(part->name));
|
||||
if (strncmp(part->name, "/", sizeof(part->name)) == 0)
|
||||
goodness++;
|
||||
for (i = 0; i <= l - 4; ++i) {
|
||||
if (strncasecmp(part->name + i, "root",
|
||||
|
|
|
@ -861,12 +861,22 @@ static inline bool blk_mq_add_to_batch(struct request *req,
|
|||
void (*complete)(struct io_comp_batch *))
|
||||
{
|
||||
/*
|
||||
* blk_mq_end_request_batch() can't end request allocated from
|
||||
* sched tags
|
||||
* Check various conditions that exclude batch processing:
|
||||
* 1) No batch container
|
||||
* 2) Has scheduler data attached
|
||||
* 3) Not a passthrough request and end_io set
|
||||
* 4) Not a passthrough request and an ioerror
|
||||
*/
|
||||
if (!iob || (req->rq_flags & RQF_SCHED_TAGS) || ioerror ||
|
||||
(req->end_io && !blk_rq_is_passthrough(req)))
|
||||
if (!iob)
|
||||
return false;
|
||||
if (req->rq_flags & RQF_SCHED_TAGS)
|
||||
return false;
|
||||
if (!blk_rq_is_passthrough(req)) {
|
||||
if (req->end_io)
|
||||
return false;
|
||||
if (ioerror < 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!iob->complete)
|
||||
iob->complete = complete;
|
||||
|
|
Loading…
Add table
Reference in a new issue