[Samba] Async Query Directory (for VFS)

Dan Greenfield dan at cuno.io
Tue May 28 21:03:48 UTC 2024


Thanks Ralph. Unfortunately that option doesn’t quite solve it. 

However even if it did, it’d still be good to add Async support for such queries. If there is WIP then I can look into finishing off the code myself. Can you point me to any branch that has this WIP? Looking through Samba source3 internals, it looks somewhat straightforward to add primitive support along the lines of Async pread, but given it hasn’t been done I assume it may not be that simple - if so what are the caveats?

- Dan

> On 28 May 2024, at 9:35 am, Ralph Boehme <slow at samba.org> wrote:
> 
> On 5/28/24 10:06 AM, Dan Greenfield via samba wrote:
>> Hi, is there a branch, patch or other attempts I can look at for
>> async processing of SMB2 QUERY_DIRECTORY? Looking online I see
>> proposals from years ago for making everything async but I don't know
>> what happened to it?
> 
> probably the same as to many other WIP branches: sitting there getting dusty. :)
> 
>> In my use case, I don't care as much about impersonation and security
>> as it's being used for client only loopback on Mac, process running
>> as the logged in user. I have a custom VFS that accesses remote
>> object storage but Spotlight (mds) on MacOS trawls recursively in
>> background resulting in lots of slow directory queries which are
>> being processed synchronously, despite handing preads and pwrites
>> asynchronously. It makes for a not great user experience when the
>> MacOS rainbow beachball shows up and otherwise smooth reads are
>> interrupted.
>> Any pointers appreciated to figure this out.
> 
> Async directory listing is certainly doable with a few weeks of work for someone really familiar with Samba internals.
> 
> Another thing you could try would be enabling spotlight on the server with the default noindex backend. Maybe the presence of *real* Spotlight on the server is enough to keep the client from falling back to what is likely the server-doesnt-support-spotlight mode.
> 
> Hth!
> -slow
> 
> -- 
> SerNet Samba Team Lead
> Samba Support, Consulting and Development
> Samba Team Member      https://samba.org/
> SAMBA+ packages       https://samba.plus/
> 



More information about the samba mailing list