Re: CIFS data coherency problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/9/13 Steve French <smfrench@xxxxxxxxx>:
> As this only takes two clients this is fairly easy to test (and prove
> Windows to Windows behavior).

I took v2.6.37 CIFS client + strictcache patches and Windows 7 and
found out that Jeff was right. The _should_ set OplockLevel on
OplockBreakAcknowledge. I attached python script that shows the
problem with 2 captures: non-patched.pcap and patched.pcap. 'patched'
one I got after I apply simple patch that set OplockLevel on
OplockBreakAcknoledge,

On the captures, we can see that the server send oplock break to one
client on non-patched variant and to both clients on patched one.
That's why I think our oplock handling code is incorrect now.

I am going to prepare it to post to the list soon.

-- 
Best regards,
Pavel Shilovsky.
#!/bin/env python
#
# We have to mount the same share to test, test1, test2 directories that locate in the directory we
# execute this script from.

from os import open, close, O_RDWR, O_CREAT, write, read, O_RDONLY, O_WRONLY, O_TRUNC, lseek, SEEK_END, SEEK_SET
import time

f = open('test/_test4321_', O_RDWR | O_CREAT | O_TRUNC)
close(f)

f1 = open('test1/_test4321_', O_RDWR)
write(f1, 'a')
lseek(f1, 0, 0)
assert('a' == read(f1, 1))

f2 = open('test2/_test4321_', O_WRONLY)
write(f2, 'x')

lseek(f1, 0, 0)

time.sleep(0.1) #need to wait untill a server breaks oplock from the previous write
assert('x' == read(f1, 1))

print 'OK'

close(f1)
close(f2)

Attachment: non-patched.pcap
Description: Binary data

Attachment: patched.pcap
Description: Binary data


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux