Skip to content

BDI lifetime fix

Jan Kara linux-block 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 1 replyIn review
  2. v24 patches 17 repliesSuperseded
  3. v1 RFC4 patches 7 repliesSuperseded

Changes in v3 from the cover letter

* Added Reviewed-by tags
* Removed slab cache for backing_dev_info
* Added patch to remove blkdev_get_backing_dev_info()

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5block: Unhash block device inodes on gendisk destructionblock/genhd.c fs/block_dev.c include/linux/fs.h+18 -00 replies
2/5block: Use pointer to backing_dev_info from request_queueblock/blk-cgroup.c block/blk-core.c block/blk-integrity.c +30 more+90 -860 replies
3/5block: Dynamically allocate and refcount backing_dev_infoblock/blk-core.c block/blk-sysfs.c include/linux/backing-dev-defs.h +3 more+50 -110 replies
4/5block: Make blk_get_backing_dev_info() safe without open bdevblock/blk-core.c fs/block_dev.c include/linux/fs.h+11 -50 replies
5/5block: Get rid of blk_get_backing_dev_info()block/blk-core.c block/compat_ioctl.c block/ioctl.c +6 more+8 -310 replies

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by.

PatchChristoph HellwigDan Williams
1/5R-b
2/5R-b
3/5
4/5R-b Reported-and-tested-by
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH 0/5 v3] BDI lifetime fix

Hello,

this is the third version of the patch series that attempts to solve the problems with the life time of a backing_dev_info structure. Currently it lives inside request_queue structure and thus it gets destroyed as soon as request queue goes away. However the block device inode still stays around and thus inode_to_bdi() call on that inode (e.g. from flusher worker) may happen after request queue has been destroyed resulting in oops.

This patch set tries to solve these problems by making backing_dev_info independent structure referenced from block device inode. That makes sure inode_to_bdi() cannot ever oops. I gave some basic testing to the patches in KVM and on a real machine, Dan was running them with libnvdimm test suite which was previously triggering the oops and things look good. So patches should be reasonably healthy.

Changes since v2:
* Added Reviewed-by tags
* Removed slab cache for backing_dev_info
* Added patch to remove blkdev_get_backing_dev_info()

Changes since v1:
* Use kref instead of atomic_t for refcount
* Get rid of free_on_put flag

Honza