<html><head></head><body>After the sprint I was on vacation.<br>I'll try to get around to it soon.<br><br>Christian<br><br><div class="gmail_quote">On August 12, 2019 4:45:19 PM GMT+02:00, Seth Forshee <seth.forshee@canonical.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On Mon, Aug 12, 2019 at 02:31:38PM +0200, Stefan Bader wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">On 26.07.19 14:59, Seth Forshee wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">On Fri, Jul 26, 2019 at 10:29:38AM +0200, Christian Brauner wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">On Thu, Jul 25, 2019 at 03:26:01PM -0500, Seth Forshee wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;">On Mon, Jul 22, 2019 at 05:05:08PM +0200, Christian Brauner wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #e9b96e; padding-left: 1ex;">On Fri, Jul 19, 2019 at 03:02:21PM -0500, Seth Forshee wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ccc; padding-left: 1ex;">On Fri, Jul 19, 2019 at 05:50:46PM +0200, Christian Brauner wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ccc; padding-left: 1ex;"> BugLink: <a href="https://bugs.launchpad.net/bugs/1837223">https://bugs.launchpad.net/bugs/1837223</a><br><br> This enabled O_DIRECT support for shiftfs if the underlay supports it.<br><br> Currently shiftfs does not handle O_DIRECT if the underlay supports it.<br> This is blocking dqlite - an essential part of LXD - from profiting from<br> the performance benefits of O_DIRECT on suitable filesystems when used<br> with async io such as aio or io_uring.<br> Overlayfs cannot support this directly since the upper filesystem in<br> overlay can be any filesystem. So if the upper filesystem does not<br> support O_DIRECT but the lower filesystem does you're out of luck.<br> Shiftfs does not suffer from the same problem since there is not concept<br> of an upper filesystem in the same way that overlayfs has it.<br> Essentially, shiftfs is a transparent shim relaying everything to the<br> underlay while overlayfs' upper layer is not (completely).<br></blockquote><br> I get concerned any time shiftfs just copies up some non-trivial data<br> from the lower filesystem, that shiftfs is going to get bypassed and<br> some important metadata will not get propoerly updated in shiftfs. The<br> question that immediately comes to mind in this case is whether i_size<br> in the shiftfs indoe gets updated following an O_DIRECT write, and I<br> suspect tha there are other similar cases to worry about. Have you<br></blockquote><br> I'm not following, what are "other similar cases to worry about" and are<br> those already exposed?<br></blockquote><br> I just mean anything else which might change in the underlay as a result<br> of I/O, e.g. timestamps.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #e9b96e; padding-left: 1ex;">Re: i_size for O_DIRECT<br>I have not seen prior art for filesystems that use iomap for O_DIRECT<br>that would fiddle with i_size so I didn't want to get into that game.<br>That is to say, shiftfs only supports O_DIRECT if the underlying<br>filesystem is iomap based. This was the same approach that overlayfs<br>wanted to use.<br></blockquote><br> Are you saying that an O_DIRECT write that extends a file does not<br> result in i_size being updated? That doesn't sound right ...<br></blockquote><br> For example, when overlayfs intended to introduce support for this<br> (which they didn't because of their version of upper and lower) they did<br> not mess with i_size. That's one of the reasons I didn't. Do you prefer<br> to copy up attributes to make sure we're not missing anything?<br></blockquote><br>I think that something like this:<br><br>  fd = open(path, O_RDWR|O_DIRECT);<br>  lseek(fd, 0, SEEK_END);<br>  write(fd, data, size);<br>  fstat(fd, &stat);<br>  printf("%ld\n", (long)stat.st_size);<br><br>Should print out the correct size (and similarly correct data for other<br>attributes). Maybe it will with this patch, I'm just not certain that it<br>will, so really I'm just asking whether you've tested this sort of<br>thing. If it doesn't work, then it seems like we probably do need to<br>copy up the attributes.<br><br>Seth<br><br></blockquote>With the long discussion seemingly stopping unresolved I am not sure this<br>patchset is ready for SRU or not.<br></blockquote><br>I think we are still waiting for Christian to get back with some test<br>results here, so these patches should wait.<br></pre></blockquote></div><br>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>