All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Hifumi Hisashi <hifumi.hisashi@lab.ntt.co.jp>
Cc: James.Bottomley@SteelEye.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] SYNCHRONIZE_CACHE on umount
Date: Thu, 12 Jan 2006 12:13:41 +0100	[thread overview]
Message-ID: <20060112111340.GC3945@suse.de> (raw)
In-Reply-To: <6.0.0.20.2.20060112180316.04202110@129.60.53.12>

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


      reply	other threads:[~2006-01-12 11:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-12  9:07 [PATCH] SYNCHRONIZE_CACHE on umount Hifumi Hisashi
2006-01-12 11:13 ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060112111340.GC3945@suse.de \
    --to=axboe@suse.de \
    --cc=James.Bottomley@SteelEye.com \
    --cc=hifumi.hisashi@lab.ntt.co.jp \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.