Skip to contentSkip to conversation

block: ensure bdi->io_pages is always initialized

PATCH In review Jens Axboe 3 participants 6 messages Aug 31, 2020 – Sep 1, 2020 Block layer

lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 block: ensure bdi->io_pages is always initialized

If a driver leaves the limit settings as the defaults, then we don't initialize bdi->io_pages. This means that file systems may need to work around bdi->io_pages == 0, which is somewhat messy.

Initialize the default value just like we do for ->ra_pages.

---

block/blk-core.c +1 -0
index d9d632639bd1..10c08ac50697 100644
@@ -539,6 +539,7 @@ struct request_queue *blk_alloc_queue(int node_id)
 		goto fail_stats;
 
 	q->backing_dev_info->ra_pages = VM_READAHEAD_PAGES;
+	q->backing_dev_info->io_pages = VM_READAHEAD_PAGES;
 	q->backing_dev_info->capabilities = BDI_CAP_CGROUP_WRITEBACK;
 	q->node = node_id;
 
Signature · 1 line
Jens Axboe
#1 lore raw
Quoted 9 lines · Jens Axboe

If a driver leaves the limit settings as the defaults, then we don't initialize bdi->io_pages. This means that file systems may need to work around bdi->io_pages == 0, which is somewhat messy.

Initialize the default value just like we do for ->ra_pages.

When queued to submit, please let us know to drop fatfs workaround "fat-avoid-oops-when-bdi-io_pages==0.patch" in akpm series.

Thanks.

Quoted 13 lines

---

block/blk-core.c +1 -0
index d9d632639bd1..10c08ac50697 100644
@@ -539,6 +539,7 @@ struct request_queue *blk_alloc_queue(int node_id)
 		goto fail_stats;
 
 	q->backing_dev_info->ra_pages = VM_READAHEAD_PAGES;
+	q->backing_dev_info->io_pages = VM_READAHEAD_PAGES;
 	q->backing_dev_info->capabilities = BDI_CAP_CGROUP_WRITEBACK;
 	q->node = node_id;
Signature · 1 line
OGAWA Hirofumi <[email protected]>
author maintainer
#2 lore raw
Quoted 6 lines · OGAWA Hirofumi
Quoted 4 lines · Jens Axboe

If a driver leaves the limit settings as the defaults, then we don't initialize bdi->io_pages. This means that file systems may need to work around bdi->io_pages == 0, which is somewhat messy.

Quoted 8 lines
Quoted 5 lines

Initialize the default value just like we do for ->ra_pages.

When queued to submit, please let us know to drop fatfs workaround "fat-avoid-oops-when-bdi-io_pages==0.patch" in akpm series.

Will do - planning on submitting it for 5.9, so probably end this week.

Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 13 lines · Jens Axboe
Quoted 12 lines · OGAWA Hirofumi
Quoted 9 lines · Jens Axboe

If a driver leaves the limit settings as the defaults, then we don't initialize bdi->io_pages. This means that file systems may need to work around bdi->io_pages == 0, which is somewhat messy.

Initialize the default value just like we do for ->ra_pages.

Quoted 5 lines
Quoted 2 lines

When queued to submit, please let us know to drop fatfs workaround "fat-avoid-oops-when-bdi-io_pages==0.patch" in akpm series.

Will do - planning on submitting it for 5.9, so probably end this week.

OK. Andrew, please drop fat-avoid-oops-when-bdi-io_pages==0.patch.

Thanks.

Signature · 1 line
OGAWA Hirofumi <[email protected]>
Reviewed-by on v1 1/1
#4 lore raw
In reply to Jens Axboe
Quoted 7 lines · Jens Axboe

If a driver leaves the limit settings as the defaults, then we don't initialize bdi->io_pages. This means that file systems may need to work around bdi->io_pages == 0, which is somewhat messy.

Initialize the default value just like we do for ->ra_pages.

This should be a fixes for the commit originally adding ->io_pages instead.

Otherwise looks good:

author maintainer
#5 lore raw
Quoted 11 lines · Christoph Hellwig
Quoted 7 lines · Jens Axboe

If a driver leaves the limit settings as the defaults, then we don't initialize bdi->io_pages. This means that file systems may need to work around bdi->io_pages == 0, which is somewhat messy.

Initialize the default value just like we do for ->ra_pages.

This should be a fixes for the commit originally adding ->io_pages instead.

Added that and your reviewed-by, thanks.

Signature · 1 line
Jens Axboe