Bug 6174 - Lock a table record in foxpro(Dbf) don't work with cifs.The data is overwritten.
Lock a table record in foxpro(Dbf) don't work with cifs.The data is overwritten.
Product: CifsVFS
Classification: Unclassified
Component: kernel fs
x86 Linux
: P3 normal
: ---
Assigned To: Jeff Layton
Depends on:
  Show dependency treegraph
Reported: 2009-03-07 14:39 UTC by Claudio Romero
Modified: 2012-04-29 21:05 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Romero 2009-03-07 14:39:32 UTC
Server: linux samba 3.0.32, (kernel oplocks=no  oplocks=no )
Client 1: linux cifs 1.55 OplockEnabled=0 (dosemu 1.2.2 lredir a cifs mount)
Cliente 2: windows 2000 SP4
Both clients add records simultaneously on the server, with
a simple program in FoxPro DOS, but does not lock well records, and
overwrites everything.
If I do that with 2 windows client, everything works fine.
If I access directly (without cifs mount)to the file(dbf table) in the server with DOSEMU everything works fine.

This is the Foxpro program's that use the clients. In linux replace "windows client" with "linux client" 
close all
use f:\temp\costo shared in 0
for CONTA=1 to 30000
	sele costo
	append blank
	if rlock()
		replace number with CONTA
		replace client with  "windows client "+str(CONTA,5)
		unlock all
Comment 1 Jeff Layton 2009-07-27 13:27:11 UTC
what sort of locking does foxpro use? POSIX or BSD locking?
Comment 2 Claudio Romero 2009-07-27 21:52:57 UTC
I don't know. Foxpro just use bytes range blocking. The problem appears when foxpro run under linux-dosemu opening tables in a cifs mount.
Cifs seems to save all cache data from the local client to the server, and overwrites the data from others clients.
Comment 3 Jeff Layton 2012-04-28 00:37:57 UTC
Sorry for the long delay in response. cifs.ko has a rather broken caching model
by default. Does this work any better if you use a fairly recent kernel and
mount with "-o strictcache" ?
Comment 4 Claudio Romero 2012-04-29 20:45:12 UTC

Retest with foxpro program.

Server: linux 32 bits samba 3.5.10, (default options)
Client 1: linux 32 bits (dosemu 1.4.0 lredir a cifs	mount)
Client 2: windows 7 64 bits

I test 
without  strictcache -> corrupt data
with strictcache -> works fine. It´s save 60000 records as expect.

I can close  this issue.

Comment 5 Jeff Layton 2012-04-29 21:05:14 UTC
Awesome. Thanks for testing it. I'm in the process of trying to make strictcache the default as well.