浏览代码

backing-dev: bdi sb prune should be in the unregister path, not destroy

Commit 592b09a42fc3ae6737a0f3ecf4fee42ecd0296f8 was different from
the tested path, in that it moved the bdi super_block prune from
unregister to destroy context. This doesn't fully fix the sync hang
bug on unexpected device removal, as need to prune the bdi cache
pointer before killing flusher thread.

Tested-by: Artur Skawina <art.08.09@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Jens Axboe 16 年之前
父节点
当前提交
8c4db3355b
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      mm/backing-dev.c

+ 2 - 1
mm/backing-dev.c

@@ -628,6 +628,8 @@ static void bdi_prune_sb(struct backing_dev_info *bdi)
 void bdi_unregister(struct backing_dev_info *bdi)
 void bdi_unregister(struct backing_dev_info *bdi)
 {
 {
 	if (bdi->dev) {
 	if (bdi->dev) {
+		bdi_prune_sb(bdi);
+
 		if (!bdi_cap_flush_forker(bdi))
 		if (!bdi_cap_flush_forker(bdi))
 			bdi_wb_shutdown(bdi);
 			bdi_wb_shutdown(bdi);
 		bdi_debug_unregister(bdi);
 		bdi_debug_unregister(bdi);
@@ -697,7 +699,6 @@ void bdi_destroy(struct backing_dev_info *bdi)
 		spin_unlock(&inode_lock);
 		spin_unlock(&inode_lock);
 	}
 	}
 
 
-	bdi_prune_sb(bdi);
 	bdi_unregister(bdi);
 	bdi_unregister(bdi);
 
 
 	for (i = 0; i < NR_BDI_STAT_ITEMS; i++)
 	for (i = 0; i < NR_BDI_STAT_ITEMS; i++)