Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ide-cd: reverse NOT_READY sense key logic

Make the case of flushing the drive's cache explicit.

There should be no functional change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

authored by

Borislav Petkov and committed by
Bartlomiej Zolnierkiewicz
3c8a48e9 3153c26b

+4 -4
+4 -4
drivers/ide/ide-cd.c
··· 341 341 342 342 switch (sense_key) { 343 343 case NOT_READY: 344 - if (blk_fs_request(rq) == 0 || rq_data_dir(rq) == READ) { 344 + if (blk_fs_request(rq) && rq_data_dir(rq) == WRITE) { 345 + if (ide_cd_breathe(drive, rq)) 346 + return 1; 347 + } else { 345 348 cdrom_saw_media_change(drive); 346 349 347 350 if (blk_fs_request(rq) && !quiet) 348 351 printk(KERN_ERR PFX "%s: tray open\n", 349 352 drive->name); 350 - } else { 351 - if (ide_cd_breathe(drive, rq)) 352 - return 1; 353 353 } 354 354 do_end_request = 1; 355 355 break;