Message ID | 20211208013534.136590-3-ebiggers@kernel.org |
---|---|
State | New |
Headers | show |
Series | None | expand |
On 12/7/21 5:35 PM, Eric Biggers wrote: > + /* Now that all child objects were deleted, the queue can be deleted. */ Shouldn't the present tense be used above (were -> are)? Anyway: Reviewed-by: Bart Van Assche <bvanassche@acm.org>
On Thu, Dec 09, 2021 at 02:38:02PM -0800, Bart Van Assche wrote: > On 12/7/21 5:35 PM, Eric Biggers wrote: > > + /* Now that all child objects were deleted, the queue can be deleted. */ > > Shouldn't the present tense be used above (were -> are)? Anyway: > > Reviewed-by: Bart Van Assche <bvanassche@acm.org> "deleted" is an action here, not a state. I think it's fine as-is, but maybe you would prefer the following? /* Now that we've deleted all child objects, we can delete the queue. */ - Eric
On 12/9/21 3:17 PM, Eric Biggers wrote: > On Thu, Dec 09, 2021 at 02:38:02PM -0800, Bart Van Assche wrote: >> On 12/7/21 5:35 PM, Eric Biggers wrote: >>> + /* Now that all child objects were deleted, the queue can be deleted. */ >> >> Shouldn't the present tense be used above (were -> are)? Anyway: >> >> Reviewed-by: Bart Van Assche <bvanassche@acm.org> > > "deleted" is an action here, not a state. I think it's fine as-is, but maybe > you would prefer the following? > > /* Now that we've deleted all child objects, we can delete the queue. */ Both alternatives work for me. Thanks, Bart.
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 3152d244e9b36..c11242ef88558 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -952,15 +952,17 @@ void blk_unregister_queue(struct gendisk *disk) */ if (queue_is_mq(q)) blk_mq_unregister_dev(disk_to_dev(disk), q); - - kobject_uevent(&q->kobj, KOBJ_REMOVE); - kobject_del(&q->kobj); blk_trace_remove_sysfs(disk_to_dev(disk)); mutex_lock(&q->sysfs_lock); elv_unregister_queue(q); disk_unregister_independent_access_ranges(disk); mutex_unlock(&q->sysfs_lock); + + /* Now that all child objects were deleted, the queue can be deleted. */ + kobject_uevent(&q->kobj, KOBJ_REMOVE); + kobject_del(&q->kobj); + mutex_unlock(&q->sysfs_dir_lock); kobject_put(&disk_to_dev(disk)->kobj);