Re: [PATCH] add execute_in_process_context() API

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

 



On Thu, 2006-02-09 at 00:30 +0900, Tejun wrote:
> I haven't really looked at the code carefully, but I think one work 
> struct + atomic counter (say pending_reap_cnt) should do it. 
> queue_work() guarantees the work is run at least once after the call, so 
> bumping pending_reap_cnt and queueing the work in target reap and 
> reaping pending_reap_cnt times in the work should work.

Actually, no, unfortunately that doesn't work (and I did actually try
it).  The problem is that the target_reap actually removes the target
from the sysfs namespace.  So, if the reap is still pending but you
cannot find the target, you'll allocate one, but then you may be racing
to add it to the namespace (i.e. a quick succession of scsi
remove-single-device followed by scsi add-single-device of the same
H/C/T/L shows this).  If you lose the race, the add fails because the
namespace is already occupied.  And, unfortunately, the device_del that
does the namespace removal requires user context ...

James


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux