• Dave Chinner's avatar
    fs: switch bdev inode bdi's correctly · a5491e0c
    Dave Chinner authored
    bdev inodes can remain dirty even after their last close. Hence the
    BDI associated with the bdev->inode gets modified duringthe last
    close to point to the default BDI. However, the bdev inode still
    needs to be moved to the dirty lists of the new BDI, otherwise it
    will corrupt the writeback list is was left on.
    
    Add a new function bdev_inode_switch_bdi() to move all the bdi state
    from the old bdi to the new one safely. This is only a temporary
    measure until the bdev inode<->bdi lifecycle problems are sorted
    out.
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    a5491e0c
block_dev.c 42.9 KB