<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    <div class="moz-cite-prefix">On 17/02/15 19:09, Bob Peterson wrote:<br>
    </div>
    <blockquote
      cite="mid:2063966524.14688631.1424200190610.JavaMail.zimbra@redhat.com"
      type="cite">
      <pre wrap="">----- Original Message -----
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi,


Since we set the allocation structure when the write call begins, and it
is not deallocated until there are no writers left with the file open,
how does this happen?

Steve.
</pre>
      </blockquote>
      <pre wrap="">
Hi,

In a normal write, the code goes through gfs2_page_mkwrite or
gfs2_file_aio_write. In the failing scenario, it's going through
sendfile. I suppose I could patch sendfile as an alternative, but
the advantage here is that this patch will do it only if a block
allocation is needed.

Regards,

Bob Peterson
Red Hat File Systems
</pre>
    </blockquote>
    <br>
    Ah, I see. In which case that code path should be patched. So it
    should be part of the splice code I think, since it should be done
    at the higher level, and not at the write_begin level, since that is
    too late. We should have a call to the reservation code too at that
    point, to ensure that we don't have fragmentation issues. So we need
    a wrapper forĀ <code>iter_file_splice_write<span class="hl opt"></span></code>
    along the lines of gfs2_file_write_iter I think,<br>
    <br>
    Steve.<br>
    <br>
  </body>
</html>