]> git.baikalelectronics.ru Git - kernel.git/commit
backing-dev: ensure that a removed bdi no longer has super_block referencing it
authorJens Axboe <jens.axboe@oracle.com>
Thu, 29 Oct 2009 10:46:12 +0000 (11:46 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 29 Oct 2009 10:46:12 +0000 (11:46 +0100)
commit2df49383e2e2a23cd6ee954d036a51d25728c60f
treed06ca7165c5dfc5224910993b36a50e54a896831
parent561fa8806a24f7c2c92697ae442f67cc405580d5
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: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
mm/backing-dev.c