<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,sans-serif">On Fri, Feb 19, 2016 at 4:43 PM, Brian Foster </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:bfoster@redhat.com" target="_blank">bfoster@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"><span>On Fri, Feb 19, 2016 at 02:34:52PM +0100, Jan Tulak wrote:<br>
> Hi guys,<br>
><br>
> what is the meaning of XLOG_MIN_RECORD_BSIZE in libxfs/xfs_log_format.h?<br>
> It is not used anywhere. I thought it might be related to -l su/sunit<br>
> option, but seeing tests with -l su=4096 (the macro is set to 16k), it<br>
> looks more like a forgotten value.<br>
><br>
<br>
</span>It's the minimum log buffer size allowed in the kernel. It's used in<br>
xfs_super.c at mount time to validate the logbsize option:<br>
<br>
        if (mp->m_logbsize != -1 &&<br>
            mp->m_logbsize !=  0 &&<br>
            (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE ||<br>
             mp->m_logbsize > XLOG_MAX_RECORD_BSIZE ||<br>
             !is_power_of_2(mp->m_logbsize))) {<br>
                xfs_warn(mp,<br>
                        "invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]",<br>
                        mp->m_logbsize);<br>
                return -EINVAL;<br>
        }<br>
<br>
I suspect it's not relevant in userspace.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">This is ok, then. Thank you for pointing me to kernel space, I didn't realised I should check it there too. :-)</div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​</div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
> There is no check for a minimal value, so I can do -l su=1 (or su=0). Are<br>
> there some caveat​s (other than performance) with such a small value? Can<br>
> it be that we are missing a check? Because<br>
> XLOG_BIG_RECORD_BSIZE<br>
> ​ and XLOG_MAX_RECORD_BSIZE are used and the upper bound is limited.​..<br>
><br>
<br>
</span>On a quick test, it looks like mkfs just ignores certain log stripe unit<br>
values that aren't block aligned. I'd probably expect this to behave<br>
similar to the '-d su' option and complain about invalid input..?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​Sounds logical and like what I expected and didn't found. I will send a patch adding this check... the only question is, what should be the minimal value? Should I check it against block size and forbid smaller sizes? Aligning a stripe unit with length 1024 on 4096 blocks doesn't looks like a nice thing. :-)</div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">(And on a quick check, it seems that -d su is doing just that.)</div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline"><br></div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">Thanks,</div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">Jan</div></div></div><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>