OSDN Git Service

fs: don't reassign dirty inodes to default_backing_dev_info
authorChristoph Hellwig <hch@lst.de>
Tue, 20 Jan 2015 21:05:00 +0000 (14:05 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 20 Jan 2015 21:05:00 +0000 (14:05 -0700)
commitc4db59d31e39ea067c32163ac961e9c80198fd37
treef4a4d6127e70f98adad3f2abfd0738abbe72d7b5
parent7b14a213890a81473ec97ad7e322d5c2f19854ae
fs: don't reassign dirty inodes to default_backing_dev_info

If we have dirty inodes we need to call the filesystem for it, even if the
device has been removed and the filesystem will error out early.  The
current code does that by reassining all dirty inodes to the default
backing_dev_info when a bdi is unlinked, but that's pretty pointless given
that the bdi must always outlive the super block.

Instead of stopping writeback at unregister time and moving inodes to the
default bdi just keep the current bdi alive until it is destroyed.  The
containing objects of the bdi ensure this doesn't happen until all
writeback has finished by erroring out.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Killed the redundant WARN_ON(), as noticed by Jan.

Signed-off-by: Jens Axboe <axboe@fb.com>
mm/backing-dev.c