Re: [PATCH V7 9/9] nvme: hold request queue's refcount in ns's whole lifetime

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

 



On Fri, 2019-04-26 at 17:11 +-0200, Christoph Hellwig wrote:
+AD4 On Thu, Apr 25, 2019 at 09:00:31AM +-0800, Ming Lei wrote:
+AD4 +AD4 The issue is driver(NVMe) specific, the race window is just between
+AD4 +AD4 between blk+AF8-cleanup+AF8-queue() and removing the ns from the controller namspace
+AD4 +AD4 list in nvme+AF8-ns+AF8-remove()
+AD4 
+AD4 And I wouldn't be surprised if others have the same issue.
+AD4 
+AD4 +AD4 
+AD4 +AD4 blk+AF8-mq+AF8-init+AF8-queue() does hold one refcount, and its counter-part is
+AD4 +AD4 blk+AF8-cleanup+AF8-queue().
+AD4 +AD4 
+AD4 +AD4 It is simply ugly to ask blk+AF8-mq+AF8-init+AF8-queue() to grab a refcnt for driver,
+AD4 +AD4 then who is the counter-part for releasing the extra refcount?
+AD4 
+AD4 Well, the problem is exactly that blk+AF8-cleanup+AF8-queue drops the reference.
+AD4 If move the blk+AF8-put+AF8-queue() call from the end of it to the callers the
+AD4 callers can keep the reference as long as they need them, and we wouldn't
+AD4 need an extra reference.

Hi Christoph,

There are more than hundred callers of blk+AF8-cleanup+AF8-queue() so that change
would cause a lot of churn. Since blk+AF8-get+AF8-queue() and blk+AF8-put+AF8-queue() are
available, how inserting a pair of calls to these functions where necessary?

Thanks,

Bart.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux