aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-09-07 19:04:00 -0400
committerJens Axboe <axboe@fb.com>2014-09-08 12:00:41 -0400
commit1a1e4530eacca37e85a4d66a164273c7dba9110c (patch)
treeade41fb1306d5efdb2868e4998926a2845c3274f /mm
parentc0ea1c22bce63a27b47da90ad1ac49ce48e1a8aa (diff)
bdi: explain the dirty list transferring in bdi_destroy()
bdi_destroy() has code to transfer the remaining dirty inodes to the default_backing_dev_info; however, given the shutdown sequence, it isn't clear how such condition would happen. Also, it isn't a full solution as the transferred inodes stlil point to the bdi which is being destroyed. Operations on those inodes can end up accessing already released fields such as the percpu stat fields. Digging through the history, it seems that the code was added as a quick workaround for a bug report without fully root-causing the issue. We probably want to remove the code in time but for now let's add a comment noting that it is a quick workaround. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/backing-dev.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index cb7c5e323814..b65fe93ad612 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -475,8 +475,17 @@ void bdi_destroy(struct backing_dev_info *bdi)
475 int i; 475 int i;
476 476
477 /* 477 /*
478 * Splice our entries to the default_backing_dev_info, if this 478 * Splice our entries to the default_backing_dev_info. This
479 * bdi disappears 479 * condition shouldn't happen. @wb must be empty at this point and
480 * dirty inodes on it might cause other issues. This workaround is
481 * added by ce5f8e779519 ("writeback: splice dirty inode entries to
482 * default bdi on bdi_destroy()") without root-causing the issue.
483 *
484 * http://lkml.kernel.org/g/1253038617-30204-11-git-send-email-jens.axboe@oracle.com
485 * http://thread.gmane.org/gmane.linux.file-systems/35341/focus=35350
486 *
487 * We should probably add WARN_ON() to find out whether it still
488 * happens and track it down if so.
480 */ 489 */
481 if (bdi_has_dirty_io(bdi)) { 490 if (bdi_has_dirty_io(bdi)) {
482 struct bdi_writeback *dst = &default_backing_dev_info.wb; 491 struct bdi_writeback *dst = &default_backing_dev_info.wb;