From: James Bottomley Date: Tue, 19 Aug 2008 22:58:13 +0000 (+0200) Subject: [SCSI] fix removable device inability to detect disk changes X-Git-Tag: v2.6.28-rc1~11^2~20 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32c356d76d7e13dcd0675189d8e9c64ef66aa561;p=pandora-kernel.git [SCSI] fix removable device inability to detect disk changes On Tue, 12 Aug 2008 15:08:14 +0200 Giuliano Pochini wrote: > Fujitsu magneto-optical drive, Adaptec 29160 and > Linux Jay 2.6.26 #7 SMP Sun Aug 10 18:34:22 CEST 2008 ppc 7455, altivec supported PowerMac3,6 GNU/Linux > > When I insert a disk and I mount it, scsi_test_unit_ready() is called and > the do-while loop gets sshdr->sense_key == UNIT_ATTENTION in the first > cycle and 0 in the second one. So the if below misses the UNIT_ATTENTION > and sdev->changed = 1 is not executed. At this point bad things can > happen... I'm not sure how to fix this. Any clue ? The problem is essentially caused by us eating UNIT_ATTENTION conditions in scsi_test_unit_ready(). Fix by updating the ->changed flag when this happens if the media is removable. [pochini@shiny.it: updates to tidy up patch] Signed-off-by: Giuliano Pochini Signed-off-by: James Bottomley --- Reading git-diff-tree failed