<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 6:53 PM, 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><br></div><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"><span>On 4/20/16 9:17 AM, Jan Tulak wrote:<br>
> I'm taking it back, one tests fails, most likely it happened when I<br>
> removed patch 17 - xfsprogs: disable truncating of files. If I do<br>
> "mkfs.xfs $file", it doesn't know the old size to recreate it. I'm<br>
> working on a change for this patch to fix this issue, but I'm not<br>
> entirely certain how to proceed. The right place to get the size<br>
> seems to be get_topology(). I could save it into xi.dsize, but then<br>
> libxfs_init() zeroes it.<br>
><br>
> So I think that I might rather convert the measured size do char<br>
> *dsize and pretend that it is an user-given value. But this looks to<br>
> me more like a hack. On the other side, any other way would require<br>
> further changes in the code to convert the char* to int as soon as<br>
> possible - which does not belong to this patch...<br>
</span>...<br>
<span><br>
> So, what do you think about this?<br>
><br>
> And before anyone will reply, I found that putting a<br>
> platform_findsizes into libxfs_init will fix it too. Which is nice,<br>
> especially because for block devices, the findsizes is already used<br>
> there. So ignore the previous hack. :-)<br>
<br>
</span>Huh - if I take your original patchset and simply remove patch 17,<br></blockquote><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">and revert this patch to the Dave's version.</div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline"></div> </div><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">
I don't get any problems with "mkfs.xfs file" for an existing file,<br>
it seems to work fine here. So it might be something else...<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I bisected it and the issue was really caused by this patch in Dave's version. But luckily, the fix is as simple as:</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">@@ -278,6 +278,8 @@ libxfs_init(libxfs_init_t *a)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> a->ddev= libxfs_device_open(dname, a->dcreat, flags,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> a->setblksize);</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> a->dfd = libxfs_device_to_fd(a->ddev);</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">+ platform_findsizes(dname, a->dfd, &a->dsize,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">+ &a->dbsize);</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> } else {</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> if (!check_open(dname, flags, &rawfile, &blockfile))</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> goto done;</div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">(and dtto for log/rt variants).</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">I'm going to send for review what I have, and work on the remaining issues in the meantime. <br></div><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Unless I find something else, the last thing to fix is that it changes the size of the file on -d size=xxx, even when O_TRUNCATE is not used (that is, no -d file is specified). Old behaviour was to keep the file size and just don't use the entire file. This affects xfs/206 and xfs/216.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Jan</div><div> </div><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">
<span><font color="#888888"><br>
-Eric<br>
</font></span><div><div><br>
_______________________________________________<br>
xfs mailing list<br>
<a href="mailto:xfs@oss.sgi.com" target="_blank">xfs@oss.sgi.com</a><br>
<a href="http://oss.sgi.com/mailman/listinfo/xfs" rel="noreferrer" target="_blank">http://oss.sgi.com/mailman/listinfo/xfs</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><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>