Re: [PATCH 2/2] bdi: Avoid oops on device removal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Tue, Feb 25, 2014 at 11:29:14PM +0100, Jan Kara wrote:
> +static void bdi_wakeup_thread(struct backing_dev_info *bdi)
> +{
> +	spin_lock_bh(&bdi->wb_lock);
> +	if (test_bit(BDI_registered, &bdi->state))
> +		mod_delayed_work(bdi_wq, &bdi->wb.dwork, 0);
> +	spin_unlock_bh(&bdi->wb_lock);
> +}

I wonder whether this can be smarter without requiring wb_lock each
timer but this probably is the simplest for -stable backports.

>  static void bdi_queue_work(struct backing_dev_info *bdi,
>  			   struct wb_writeback_work *work)
>  {
>  	trace_writeback_queue(bdi, work);
>  
>  	spin_lock_bh(&bdi->wb_lock);
> +	if (!test_bit(BDI_registered, &bdi->state)) {
> +		if (work->done)
> +			complete(work->done);
> +		goto out_unlock;
> +	}
>  	list_add_tail(&work->list, &bdi->work_list);
> -	spin_unlock_bh(&bdi->wb_lock);
> -
>  	mod_delayed_work(bdi_wq, &bdi->wb.dwork, 0);
> +out_unlock:
> +	spin_unlock_bh(&bdi->wb_lock);
>  }
>  
> +
> +

Why three blank lines?

Other than that,

Reviewed-by: Tejun Heo <tj@xxxxxxxxxx>

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux