> + /* > + * Do not attempt to freeze the queue of an already quiesced device > + * because that could result in a deadlock. > + */ > + freeze = sdev->sdev_state == SDEV_RUNNING; > + if (freeze) > + blk_mq_freeze_queue(q); > err = scsi_device_set_state(sdev, SDEV_QUIESCE); I don't really like this magic with a freeze inside the lock and the magic dependency on the previous. But I can't really come up with a better idea either.