[Stgt-devel] disabling write cache?

Mark Harvey markh794
Wed Jun 25 06:06:21 CEST 2008


Darn.. Finger problems.

Let me complete that email.

This (sending sense data on SAM_STAT_GOOD), has been my stumbling
block for SSC device. It is needed to indicate short/long block reads
in SSC for variable block size.

Cheers
Mark

On Wed, Jun 25, 2008 at 2:04 PM, Mark Harvey <markh794 at gmail.com> wrote:
> Re: http://stgt.berlios.de/patches/0001-iscsi-fix-sense-handling.patch
>
> So thats where it is...
>
> I've been scratching my head over this for ages.
> This (sending sense data on SAM_STAT_GOOD)
>
> On Wed, Jun 25, 2008 at 12:10 PM, FUJITA Tomonori
> <fujita.tomonori at lab.ntt.co.jp> wrote:
>> On Thu, 19 Jun 2008 13:54:15 +0200
>> Tomasz Chmielewski <mangoo at wpkg.org> wrote:
>>
>>> Is there a way to disable write caching when using tgtd as a target?
>>>
>>> Right now, it seems to be impossible (at least I didn't find an option
>>> in documentation nor sources) and setting it on the initiator fails:
>>>
>>> initiator# sdparm /dev/sda
>>>      /dev/sda: IET       VIRTUAL-DISK  0001
>>> Caching (SBC) mode page:
>>>    WCE         1  [cha: y, def:  1, sav:  1]
>>>    RCD         0  [cha: n, def:  0, sav:  0]
>>> (...)
>>>
>>> initiator# sdparm --set WCE=0 /dev/sda
>>>      /dev/sda: IET       VIRTUAL-DISK  0001
>>> change_mode_page: failed setting page: Caching (SBC)
>>
>> I've uploaded two patches:
>>
>> http://stgt.berlios.de/patches/0001-iscsi-fix-sense-handling.patch
>> http://stgt.berlios.de/patches/0002-sbc-add-WCE-support-to-bs_rdwr.patch
>>
>> With the patches, you can disable write caching in the following way:
>>
>> tgtadm --lld iscsi --op update --mode logicalunit --tid 1 --lun 1 --params mode_page=8:0:18:0x10:0:0xff:0xff:0:0:0xff:0xff:0xff:0xff:0x80:0x14:0:0:0:0:0:0
>>
>> Note that you need to modify tid and lun in your environment.
>>
>>
>> Shortly, I'll let you control write caching via sdparm too.
>> _______________________________________________
>> Stgt-devel mailing list
>> Stgt-devel at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/stgt-devel
>>
>



More information about the stgt mailing list