Re: [PATCH RFC] Remove the cancel_delayed_work() call from scsi_put_command()

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

 



On 05/23/14 11:24, Paolo Bonzini wrote:
> Il 23/05/2014 08:09, Hannes Reinecke ha scritto:
>>
>> And when freeing a command we absolutely need to make sure that
>> the workqueue is empty.
>> So calling cancel_delayed_work() was the obvious thing to do.
> 
> You would need cancel_delayed_work_sync, but if it really happened that
> the work item is running, it would cause a double free.
> 
>> I'd be fine with adding a WARN_ON(!list_empty(&cmd->abort_work))
>> here, however. This will clear up the intent of this statement.
> 
> BUG_ON even, since you'd get badness from the double free anyway.

Hello Paolo,

Are you aware that Linus strongly prefers WARN_ON_ONCE() over BUG_ON() ?
See e.g. https://lkml.org/lkml/2012/9/27/461 or
https://lkml.org/lkml/2014/4/28/657.

Bart.

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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux