2002-01-04 13:49:32

by Eshwar D - CTD, Chennai.

[permalink] [raw]
Subject: Reg: SCSI

Hai all,
In my project while reading/writing the data in to scsi disk, I need
to block the device using RESERVE UNIT and RELEASE UNIT. Can any one help me
how to send SCSI command to SCSI device. I know that this can be done under
user level using SCSI generic interface. I required function in kernel
version 2.4.2. level.

Thanks u
D.Eshwar,
Member Techinical Staff,
HCL Techonologies Ltd.,
D-12 & 12-B, 3rd South Street,
SIDCO Industrial Estate,
Ambattur,
Chennai - 600 058.

Disclaimer:
This document is intended for transmission to the named recipient only. If
you are not that person, you should note that legal rights reside in this
document and you are not authorized to access, read, disclose, copy, use or
otherwise deal with it and any such actions are prohibited and may be
unlawful. The views expressed in this document are not necessarily those of
HCL Technologies Ltd. Notice is hereby given that no representation,
contract or other binding obligation shall be created by this e-mail, which
must be interpreted accordingly. Any representations, contractual rights or
obligations shall be separately communicated in writing and signed in the
original by a duly authorized officer of the relevant company.




-----Original Message-----
From: Urban Widmark [mailto:[email protected]]
Sent: Thursday, December 27, 2001 7:07 PM
To: Eshwar D - CTD, Chennai.
Cc: [email protected]
Subject: Re: SMBFS reading & Time sync problem


On Thu, 27 Dec 2001, Eshwar D - CTD, Chennai. wrote:

> Hai,
> I am using kernel version 2.4.2. and samba version is 2.2.0. and

2.4.3 may have a fix for this if the size of the file changes. Upgrade to
a newer kernel and see if this doesn't work better there.

smbfs does not really support this kind of sharing anyway. It caches
things without having an "oplock" on the server. Without an oplock it
should always re-read everything (hard to do for mmap'ed files).

There is also an assumption in a lot of the code that the file does not
change on the server.


> To avoid this problem my suggestion is
>
> 1. While every write the modified time to be notified to sever by
> sending SMBsetattr.

That will cut the transfer rate in half (roughly) and there is no
guarantee that it will work as some servers do not seem to respond with
the recently written attributes.

I don't think that is the best way to do this. oplocks + proper
invalidation should be a lot safer. Setting attributes depends on the
clocks of the machines being somewhat in sync.


Please test 2.4.17 (or a more recent kernel from your vendor). If that
doesn't work could you then send me a testprogram/script that triggers
this. Thanks.

/Urban


2002-01-05 01:41:41

by Douglas Gilbert

[permalink] [raw]
Subject: Re: Reg: SCSI

Eshwar D - CTD, Chennai wrote:

> In my project while reading/writing the data in
> to scsi disk, I need to block the device using
> RESERVE UNIT and RELEASE UNIT. Can any one help me
> how to send SCSI command to SCSI device. I know that
> this can be done under user level using SCSI generic
> interface. I required function in kernel version
> 2.4.2. level.

See:
http://www.linuxdoc.org/HOWTO/SCSI-Generic-HOWTO/

To break reservations from a crippled SCSI initiator, the
other initiator needs access to a SCSI bus reset. Even
though the sg driver supports this, the SCSI mid-level
support is missing in the standard lk 2.4 series. Many
distributions have the required patch (from James
Bottomley) that makes SCSI bus reset functional.

That SCSI bus reset mid-level patch for the lk 2.5 series
will be heading in Jens's direction shortly.

Doug Gilbert