Grzegorz Prokopski <[EMAIL PROTECTED]> writes:
> Hi!
>
> I've seen similar topics on that list, but this time I'll
> problably be going to try solving this problem myself.
> It looks this way:
> We want remote acces to an dos database application.
> Everything's works just fine, everything but file locks ;(
>
> I did some simple investigation (dosemu 0.99-1 - it was
> before You released 1.0 , but I don't think problem was
> solved there; and MS-DOS 6.22 ):
> 1. I checked a few dosemu's on ONE computer and dosemu
> file locking works fine (strange - why ?, how ?)
> 2. When I run a samba or (real) novell serwer in enviroment
> where are Windows clients, and (i checked one, but only for
> tests, in future I would like to run more) Linux box with
> a few dosemu's. File locking worked (partially) only in one
> case. I lock file with dosemu - Windows sees it - I unlock
> lock from dosemu - Windows doesn't see it ;( and program
> waits until interrupted. Otherwise locks are not seen.
> 3. My friend told me (but I can't say he *must* be right)
> that locks worked "better" with mars_nwe novell emulator.
>
> (At the moment I can't exactly say what flock's the dos
> program needs - probably it locks all the file, that
> nobody else has acces to it at the moment)
>
> What I need and why I wrote it ?
> I haven't yet looked at all the code, but I see that problem
> can be in a few layer's. I think (maybe Iam wrong at some
> point?) there are such:
> - Application call dos function (lock/unlock)
> - it goes thru lredir
> - file lock i set on UNIX FS layer
> - automaticaly it goes set on server by specific server
> client (smb or netware)
>
> I would like to know where the problem is (or where isn't).
> And how hard will it be to solve this. Is it possible
> to solve anyway ? Where to start ?
In dosemu the file to look at is: src/dosext/mfs/mfs.c
look for struct flock.
>
> How should be this done "right" way ? Any advices, thoughts,
> any help - is welcome. ;) (To priv'a addres I think)
Get traces at each layer, and see what is going on.
For the dosemu layer start running dosemu as dos -D+d -o debug_file
which should record all of the locking/unlocking calls
as well as many other disk based things...
An interesting thing to look for is:
Unlock file region
It looks like that is a call without code behind it.
But the LOCK_FILE_REGION call seems to have unlocking code...
>
> I'am sure dosemu team knows this problem for long time.
> Have you been trying to solve this? Sure - yes.
> What are Your expiriences ? Where to look for doc's, spec's ?
Ralph Brown's interrupt list is handy for the dos side.
But if you can create a straigh linux program with the
same problems, (a) you remove a layer. (b) make it possible
to go talk to the Samba folks or whatever...
Locking has come up now and then but we haven't done much.
>
> I wish I could push dosemu to be better a bit. I'am sure
> lot's of people has similar problem. And *maybe* (hope so)
> I got an occasion to clean that issue. Need to know more
> about the problem.
Well dig in, the code is a little on the rough side
but it it's readable enough.
Hope my hints help,
Eric