general protection fault in __queue_work (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Jens Axboe
maintainerQuoted 4 lines · Hillf Danton
(quoted diff) +0
-0@@ -1208,8 +1211,16 @@ static int __loop_clr_fd(struct loop_dev * * 3) unlock, del_timer_sync so if timer raced it will be a no-op */
Review static int __loop_clr_fd(struct loop_dev · line 1222
Quoted 10 lines
(quoted diff) +8
-1- loop_unprepare_queue(lo); spin_lock_irq(&lo->lo_lock); + do { + struct workqueue_struct *wq = lo->workqueue; + + lo->workqueue = ERR_PTR(-EINVAL); + spin_unlock_irq(&lo->lo_lock); + destroy_workqueue(wq); + spin_lock_irq(&lo->lo_lock); + } while (0);
This looks highly suspicious, what's the point of this loop?
Also think this series a) might not be fully cooked, and b) really should have gone through the block tree.
Signature · 1 line
Jens Axboe
A message that is not in the archive (sent off-list or not yet received): [email protected]
Jens Axboe
maintainerQuoted 20 lines · Hillf Danton
Quoted 17 lines · On Sun, 8 Mar 2020 10:17:33 -0600 Jens Axboe wrote:
Quoted 4 lines · Hillf Danton
(quoted diff) +0
-0@@ -1208,8 +1211,16 @@ static int __loop_clr_fd(struct loop_dev * * 3) unlock, del_timer_sync so if timer raced it will be a no-op */Review static int __loop_clr_fd(struct loop_dev · line 1222
Quoted 10 lines
(quoted diff) +8
-1- loop_unprepare_queue(lo); spin_lock_irq(&lo->lo_lock); + do { + struct workqueue_struct *wq = lo->workqueue; + + lo->workqueue = ERR_PTR(-EINVAL); + spin_unlock_irq(&lo->lo_lock); + destroy_workqueue(wq); + spin_lock_irq(&lo->lo_lock); + } while (0);This looks highly suspicious, what's the point of this loop?
Quoted 2 lines
It is a while(0) loop that just gives me the chance for adding the transient local variable wq.
I think that adds more confusion than what is necessary, and I don't think the approach is great to begin with as you now need various checks as well for the workqueue pointer.
We're freezing the queue right after anyway, which will ensure that nobody is going to hit an invalid workqueue pointer in terms of queueing. This looks more like an ordering issue.
Quoted 4 lines
Quoted 2 lines
Also think this series a) might not be fully cooked, and b) really should have gone through the block tree.
Gavel in your hand, Sir.
Andrew, can you please drop this series so we can work out the kinks and get it properly queued up after?
Signature · 1 line
Jens Axboe