lkml.org 
[lkml]   [2020]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] scsi: sd: stop SSD (non-rotational) disks before reboot
From
Date
On 2020-06-17 11:49, Simon Arlott wrote:
> @@ -3576,9 +3582,19 @@ static void sd_shutdown(struct device *dev)
> sd_sync_cache(sdkp, NULL);
> }
>
> - if (system_state != SYSTEM_RESTART && sdkp->device->manage_start_stop) {
> - sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n");
> - sd_start_stop_device(sdkp, 0);
> + if (sdkp->device->manage_start_stop) {
> + bool stop_disk = (system_state != SYSTEM_RESTART);
> +
> + if (stop_before_reboot > 1) { /* stop all disks */
> + stop_disk = true;
> + } else if (stop_before_reboot) { /* non-rotational only */
> + stop_disk |= blk_queue_nonrot(sdkp->disk->queue);
> + }
> +
> + if (stop_disk) {
> + sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n");
> + sd_start_stop_device(sdkp, 0);
> + }
> }
> }

Is introduction of a new kernel module parameter essential? Or in other
words, has it been considered to apply the new behavior to all SSDs?

Thanks,

Bart.

\
 
 \ /
  Last update: 2020-06-17 21:21    [W:0.149 / U:1.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site