* [PATCH] SYNCHRONIZE_CACHE on umount
@ 2006-01-12 9:07 Hifumi Hisashi
2006-01-12 11:13 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Hifumi Hisashi @ 2006-01-12 9:07 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi
Hi.
When a SCSI HDD(WCE bit is set) is umounted, SYNCHRONIZE_CACHE(35h)
command is not issued under current sd driver.
When an IDE HDD is umounted, FLUSH CACHE is issued through
idedisk_release().
I suppose that the sd driver also needs to flush cache through umount.
Thanks.
Signed-off-by: Hifumi Hisashi <hifumi.hisashi@lab.ntt.co.jp>
--- linux-2.6.15/drivers/scsi/sd.c 2006-01-12 16:23:44.000000000 +0900
+++ linux-2.6.15_fix/drivers/scsi/sd.c 2006-01-12 16:43:04.000000000 +0900
@@ -503,6 +503,8 @@
SCSI_LOG_HLQUEUE(3, printk("sd_release: disk=%s\n", disk->disk_name));
+ if (sdkp->WCE)
+ sd_sync_cache(sdev);
if (!--sdkp->openers && sdev->removable) {
if (scsi_block_when_processing_errors(sdev))
scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] SYNCHRONIZE_CACHE on umount
2006-01-12 9:07 [PATCH] SYNCHRONIZE_CACHE on umount Hifumi Hisashi
@ 2006-01-12 11:13 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2006-01-12 11:13 UTC (permalink / raw)
To: Hifumi Hisashi; +Cc: James.Bottomley, linux-scsi
On Thu, Jan 12 2006, Hifumi Hisashi wrote:
> Hi.
> When a SCSI HDD(WCE bit is set) is umounted, SYNCHRONIZE_CACHE(35h)
> command is not issued under current sd driver.
>
> When an IDE HDD is umounted, FLUSH CACHE is issued through
> idedisk_release().
> I suppose that the sd driver also needs to flush cache through umount.
>
> Thanks.
>
> Signed-off-by: Hifumi Hisashi <hifumi.hisashi@lab.ntt.co.jp>
>
> --- linux-2.6.15/drivers/scsi/sd.c 2006-01-12 16:23:44.000000000 +0900
> +++ linux-2.6.15_fix/drivers/scsi/sd.c 2006-01-12 16:43:04.000000000 +0900
> @@ -503,6 +503,8 @@
>
> SCSI_LOG_HLQUEUE(3, printk("sd_release: disk=%s\n",
> disk->disk_name));
>
> + if (sdkp->WCE)
> + sd_sync_cache(sdev);
> if (!--sdkp->openers && sdev->removable) {
> if (scsi_block_when_processing_errors(sdev))
> scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW);
Wrong way to place it, imo. If you are pushing out dirty data on umount,
the core should make sure to do a blkdev_issue_flush() afterwards. Then
you don't have to put it in each and every driver.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-01-12 11:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-12 9:07 [PATCH] SYNCHRONIZE_CACHE on umount Hifumi Hisashi
2006-01-12 11:13 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).