Re: cifs: Deferred close for files

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

 



I have added test cifs/105 that triggers oplock breaks. I think it could
be used as a base or be modified to test your code (unless you already
have some script). In anycase I would like to make sure we can trigger
the codepath you are adding on the buildbot. My script is in
/root/buildbot/scripts/fedora29/cifs/105 and it simply calls the
optest.py script in the same directory.

The code is essentially:

    for x in range(n_children):
        pid = os.fork()
        if pid == 0:
            for i in range(n_it):
                a = open(fna, 'w+') # file accessed by first mount point A
                b = open(fnb, 'r')  # same file via 2nd mount point B
                b.close()
                a.close()
            exit(0)

That python script mounts the same share twice but with -o nosharesock,
to disable connection reuse (so you have 2 TCP connection).

Then it creates n_children, and each children is opening/closing for
read or write the same file (but accessed through different mount
point) in a loop (n_it times).

If a process has opened it for READ it will open it with a READ lease,
so that multiple client can cache reads.

As soon as one process opens it for writes, it will make the server
notify clients that have a READ lease on the file to downgrade it. This
notification is the oplock break.

Cheers,
-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)






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

  Powered by Linux