Re: [PATCH 07/15] writeback: split inode_wb_list_lock into bdi_writeback.list_lock

Andrew Morton
2011-06-07T23:04:30Z

On Wed, 08 Jun 2011 05:32:43 +0800
Wu Fengguang <fengguang.wu@intel.com> wrote:

> static void bdev_inode_switch_bdi(struct inode *inode,
> struct backing_dev_info *dst)
> {
> - spin_lock(&inode_wb_list_lock);
> + struct backing_dev_info *old = inode->i_data.backing_dev_info;
> +
> + if (unlikely(dst == old)) /* deadlock avoidance */
> + return;

Why does this occur?