Native Linux AIO in Samba4

James Peach jpeach at samba.org
Fri Jan 12 21:39:57 GMT 2007


On Jan 12, 2007, at 1:07 PM, tridge at samba.org wrote:

> Dan,
>
>> What does HFS mean? I only know of an HP filesystem of that name  
>> (and an
>> Apple one, which I don't believe.)
>
> I meant it as a generic term for hierarchical file systems. I should
> have explained.

[snip]

> So for people who, for whatever reason, use Samba on NFS, we need more
> operations to be async. On the other hand, read() can take minutes on
> a HFS system in extreme cases, so async read is really important.
>
> One thing I've asked Suparna about is to have a way to ask the kernel
> "would this read request be satisfied immediately, or will it block?"

This should already happen on Linux, since the NFS server relies on it  
to generate jukebox errors. I know that it works for XFS+DMF.

> so we can choose to only use AIO calls when needed. My preference is
> to support the same method as sockets, which is:
>
>  fcntl(fd, F_SETFL, O_NONBLOCK),
>
> (or some other equivalent fcntl flag). So what smbd would do is:
>
>  - when opening a file, set it as O_NONBLOCK
>  - always use pread()
>  - when pread returns -1/EWOULDBLOCK or -1/EAGAIN then fall back to
>    AIO calls

An NFS server in front of a HFS will usually translate these into  
NFS3ERR_JUKEBOX. The client is expected to back off and retry the  
request later. Is there any way to convince Windows clients into  
similar behaviour?

--
James Peach | jpeach at samba.org



More information about the samba-technical mailing list