<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,sans-serif">On Wed, Apr 20, 2016 at 11:51 AM, Jan Tulak </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:jtulak@redhat.com" target="_blank">jtulak@redhat.com</a>></span><span style="font-family:arial,sans-serif"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class=""><div style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,sans-serif">On Thu, Apr 14, 2016 at 11:49 AM, Jan Tulak </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:jtulak@redhat.com" target="_blank">jtulak@redhat.com</a>></span><span style="font-family:arial,sans-serif"> wrote:</span><br></div></span><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><span><div style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,sans-serif">On Fri, Apr 8, 2016 at 4:58 PM, Jan Tulak </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:jtulak@redhat.com" target="_blank">jtulak@redhat.com</a>></span><span style="font-family:arial,sans-serif"> wrote:</span><br></div></span><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,sans-serif">On Fri, Apr 8, 2016 at 2:25 AM, Eric Sandeen </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:sandeen@sandeen.net" target="_blank">sandeen@sandeen.net</a>></span><span style="font-family:arial,sans-serif"> wrote:</span><span style="font-family:arial,sans-serif;color:rgb(34,34,34)"> </span><span style="font-family:arial,sans-serif;color:rgb(34,34,34)"> </span></div></div></div></div></blockquote></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><span>[<div style="font-family:arial,helvetica,sans-serif;display:inline">​snip]​</div><span><br style="color:rgb(34,34,34)"><span style="color:rgb(34,34,34)">I still think this patch might need a reset though :)</span><br style="color:rgb(34,34,34)"><br style="color:rgb(34,34,34)"><span style="color:rgb(34,34,34)">Thanks,</span><br style="color:rgb(34,34,34)"><span style="color:rgb(34,34,34)">-Eric</span><br style="color:rgb(34,34,34)"></span></span><span style="color:rgb(34,34,34)"><span><br></span></span></div></div></blockquote><div><br></div><span><div style="font-family:arial,helvetica,sans-serif">​On few places, the original patch looked as if files had direct IO still enabled​ (using platform_findsize...), and I think it was causing some failures - fixing issues is why I did most of the changes.</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">I will revert to the original version and see what exactly fails. But with being Friday late afternoon, the results will be available the next week (Wednesday and further, all my courses at university are stuffed in Mon/Tue).</div><div style="font-family:arial,helvetica,sans-serif"><br></div></span></div></div></div></blockquote><div><br></div><div><div style="font-family:arial,helvetica,sans-serif;display:inline">​All right. So I run the tests on the set with both this and the original version of this patch and there is no change in results. Here and there some tests failed on one run, but on other runs they are ok and I can't get them to fail again (namely, xfs/033, 073 and 085 did this).</div></div><div><div style="font-family:arial,helvetica,sans-serif;display:inline"><br></div></div><div><div style="font-family:arial,helvetica,sans-serif;display:inline">It looks like whatever the issues were to start the changes, they are already resolved. Thus, I will send the original patch in the next batch.</div><br></div><div><br></div></div></div></div></blockquote></span><div style="font-family:arial,helvetica,sans-serif">​I'm taking it back, one tests fails, most likely it happened when I removed patch 17 - xfsprogs: disable truncating of files.</div><div style="font-family:arial,helvetica,sans-serif">If I do "mkfs.xfs $file", it doesn't know the old size to recreate it. I'm working on a change for this patch to fix this issue, but I'm not entirely certain how to proceed. The right place to get the size seems to be get_topology(). I could save it into xi.dsize, but then libxfs_init() zeroes it.</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">So I think that I might rather convert the measured size do char *dsize and pretend that it is an user-given value. But this looks to me more like a hack. On the other side, any other way would require further changes in the code to convert the char* to int as soon as possible - which does not belong to this patch...</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">Diff of the change:</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div><div><div><font face="arial, helvetica, sans-serif">@@ -999,7 +999,7 @@ static void get_topology(</font></div><span class=""><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">                fd = open(dfile, flags, 0666);</font></div></span><span class=""><div><font face="arial, helvetica, sans-serif">                if (fd >= 0) {</font></div><div><font face="arial, helvetica, sans-serif">-                       platform_findsizes(dfile, fd, &dummy, &ft->lsectorsize);</font></div></span><div><font face="arial, helvetica, sans-serif">+                       platform_findsizes(dfile, fd, &xi->dsize, &ft->lsectorsize);</font></div><div><font face="arial, helvetica, sans-serif">                        close(fd);</font></div><span class=""><div><font face="arial, helvetica, sans-serif">                        ft->psectorsize = ft->lsectorsize;</font></div></span><div><font face="arial, helvetica, sans-serif">                } else</font></div><div><font face="arial, helvetica, sans-serif">@@ -2273,6 +2273,18 @@ _("Minimum block size for CRC enabled filesystems is %d bytes.\n"),</font></div><span class=""><div><font face="arial, helvetica, sans-serif">        memset(&ft, 0, sizeof(ft));</font></div><div><font face="arial, helvetica, sans-serif">        get_topology(&xi, &ft, force_overwrite);</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div></span><div><font face="arial, helvetica, sans-serif">+       /*</font></div><div><font face="arial, helvetica, sans-serif">+        * If it is an existing file and we have no info about it</font></div><div><font face="arial, helvetica, sans-serif">+        * like in case of "mkfs.xfs some-file", we need to save the size</font></div><div><font face="arial, helvetica, sans-serif">+        * of the file to somewhere where it can be read later.</font></div><div><font face="arial, helvetica, sans-serif">+        */</font></div><div><font face="arial, helvetica, sans-serif">+       if (xi.disfile && !xi.dcreat && xi.dsize) {</font></div><div><font face="arial, helvetica, sans-serif">+               long long num = xi.dsize * ft.lsectorsize;</font></div><div><font face="arial, helvetica, sans-serif">+               int length = snprintf(NULL, 0,"%lld", num);</font></div><div><font face="arial, helvetica, sans-serif">+               dsize = calloc( length + 1 ,sizeof(char));</font></div><div><font face="arial, helvetica, sans-serif">+               sprintf(dsize, "%lld", num);</font></div><div><font face="arial, helvetica, sans-serif">+       }</font></div><div><font face="arial, helvetica, sans-serif">+</font></div><div><font face="arial, helvetica, sans-serif">        if (!ssflag) {</font></div><div><font face="arial, helvetica, sans-serif">                /*</font></div><div><font face="arial, helvetica, sans-serif">                 * Unless specified manually on the command line use the</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">So, what do you think about this?</font></div><div><br></div></div></div></div></div></div></blockquote></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">And before anyone will reply, I found that putting a platform_findsizes​ into libxfs_init will fix it too. Which is nice, especially because for block devices, the findsizes is already used there. So ignore the previous hack. :-)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Cheers,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Jan</div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Jan Tulak<br></div><a href="mailto:jtulak@redhat.com" target="_blank">jtulak@redhat.com</a> / <a href="mailto:jan@tulak.me" target="_blank">jan@tulak.me</a></div></div></div></div>
</div></div>