Skip to content
Commit 592b09a4 authored by Jens Axboe's avatar Jens Axboe
Browse files

backing-dev: ensure that a removed bdi no longer has super_block referencing it



When the bdi is being removed, we have to ensure that no super_blocks
currently have that cached in sb->s_bdi. Normally this is ensured by
the sb having a longer life span than the bdi, but if the device is
suddenly yanked, we have to kill this reference. sb->s_bdi is pointed
to freed memory at that point.

This fixes a problem with sync(1) hanging when a USB stick is pulled
without cleanly umounting it first.

Reported-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 960cc0f4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment