[Samba] How samba guarantee close-to-open consistency?

Jeremy Allison jra at samba.org
Wed Jun 29 16:07:10 UTC 2022


On Wed, Jun 29, 2022 at 06:57:45PM +0800, jie wang via samba wrote:
>If we only open file for read, and when we close it, do we also need to
>signall all other smbds to drop cache ?
>
>"But if you really want to cache on the server side, you could signal all
>other smbds with a message to drop the cache when you process the close
>in your VFS module."

Helping implement directory leases in Samba so clients can
do all the caching would be the best solution for this IMHO.

Remember, the Windows redirector has all the code to cache
file opens (reads and writes) - which we already support via
leases, and also directory content caching - for which we
just need some help to finish up (I believe the code is
already prototyped, not sure).

>On Wed, Jun 29, 2022 at 6:09 PM jie wang <yjxxtd12 at gmail.com> wrote:
>
>> Thanks the reply, I'm interested in the DOS attributes, how can we avoid
>> storing an xattr ?
>>
>> "Another question would be which metadata your shooting for? stat info?
>> DOS attributes? For the latter we have some design ideas to avoid the
>> need to store an xattr with the DOS attributes for the default case."
>>
>> On Thu, Jun 23, 2022 at 10:37 PM Ralph Boehme <slow at samba.org> wrote:
>>
>>> On 6/23/22 15:54, jie wang wrote:
>>> > Yes, we implement a vfs module which has cache. And we want to get
>>> > attributes from cache when samba calls openat.
>>>
>>> well, I guess the correct way to tackle this would be to let the
>>> *clients* do the caching with leases for file data and with directory
>>> leases for file metadata.
>>>
>>> But if you really want to cache on the server side, you could signal all
>>> other smbds with a message to drop the cache when you process the close
>>> in your VFS module.
>>>
>>> Another question would be which metadata your shooting for? stat info?
>>> DOS attributes? For the latter we have some design ideas to avoid the
>>> need to store an xattr with the DOS attributes for the default case.
>>>
>>> Cheers!
>>> -slow
>>>
>>> --
>>> Ralph Boehme, Samba Team                 https://samba.org/
>>> SerNet Samba Team Lead      https://sernet.de/en/team-samba
>>>
>>
>-- 
>To unsubscribe from this list go to the following URL and read the
>instructions:  https://lists.samba.org/mailman/options/samba



More information about the samba mailing list