[Samba] stat between reads

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Mar 22 10:24:20 MDT 2013


On Fri, Mar 22, 2013 at 03:18:53PM +0100, Frank Kautz wrote:
> Hello,
> 
> when re-exporting the parallel (network) file-system FhGFS, I noticed a
> significantly reduced read performance. In the output of strace, I see a
> stat call between the reads of the blocks of a file. In a network based
> file system a stat could be expensive. I looked into the source code and
> I think the stat is done in the method send_file_readX() (file:
> source3/smbd/reply.c) which calls fsp_stat(). What is the reason for
> this stat? Is it possible to disable this stat by a configuration option
> or just avoid it in the code?

If I see it right, we could avoid most of those calls.
First, they are only relevant to see whether we can do
sendfile. That choice is racy, we first look and have to
deal with the mess if we have a short read afterwards
anyway.

Jeremy, what do you think? Only do that stat call in the
sendfile if-branch, and there only if the read call in
question would go beyond what we currently have in
st.st_ex_size?

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba mailing list