xfs
[Top] [All Lists]

Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?)

To: Jan Tulak <jtulak@xxxxxxxxxx>
Subject: Re: What is the meaning of XLOG_MIN_RECORD_BSIZE? (Missing a check?)
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Fri, 19 Feb 2016 11:29:13 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <CACj3i72wijiApA0gD0mRrMvPomDC5pEAr1Mvv6e3vi4HU1S_sw@xxxxxxxxxxxxxx>
References: <CACj3i70osVyt=QTTqoqKGttwNC8w7Gtq479-Nk-icQrDn83hCA@xxxxxxxxxxxxxx> <20160219154347.GA27263@xxxxxxxxxxxxxxx> <CACj3i72wijiApA0gD0mRrMvPomDC5pEAr1Mvv6e3vi4HU1S_sw@xxxxxxxxxxxxxx>
User-agent: Mutt/1.5.24 (2015-08-30)
On Fri, Feb 19, 2016 at 05:16:28PM +0100, Jan Tulak wrote:
> On Fri, Feb 19, 2016 at 4:43 PM, Brian Foster <bfoster@xxxxxxxxxx> wrote:
> 
> > On Fri, Feb 19, 2016 at 02:34:52PM +0100, Jan Tulak wrote:
> > > Hi guys,
> > >
> > > what is the meaning of XLOG_MIN_RECORD_BSIZE in libxfs/xfs_log_format.h?
> > > It is not used anywhere. I thought it might be related to -l su/sunit
> > > option, but seeing tests with -l su=4096 (the macro is set to 16k), it
> > > looks more like a forgotten value.
> > >
> >
> > It's the minimum log buffer size allowed in the kernel. It's used in
> > xfs_super.c at mount time to validate the logbsize option:
> >
> >         if (mp->m_logbsize != -1 &&
> >             mp->m_logbsize !=  0 &&
> >             (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE ||
> >              mp->m_logbsize > XLOG_MAX_RECORD_BSIZE ||
> >              !is_power_of_2(mp->m_logbsize))) {
> >                 xfs_warn(mp,
> >                         "invalid logbufsize: %d [not 16k,32k,64k,128k or
> > 256k]",
> >                         mp->m_logbsize);
> >                 return -EINVAL;
> >         }
> >
> > I suspect it's not relevant in userspace.
> >
> 
> This is ok, then. Thank you for pointing me to kernel space, I didn't
> realised I should check it there too. :-)
> â
> 
> 
> >
> > > There is no check for a minimal value, so I can do -l su=1 (or su=0). Are
> > > there some caveatâs (other than performance) with such a small value? Can
> > > it be that we are missing a check? Because
> > > XLOG_BIG_RECORD_BSIZE
> > > â and XLOG_MAX_RECORD_BSIZE are used and the upper bound is limited.â..
> > >
> >
> > On a quick test, it looks like mkfs just ignores certain log stripe unit
> > values that aren't block aligned. I'd probably expect this to behave
> > similar to the '-d su' option and complain about invalid input..?
> >
> 
> â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. :-)
> (And on a quick check, it seems that -d su is doing just that.)
> 

The man page says it must be a multiple of the fsb size. Indeed, '-d su'
complains about anything that is less than 1 FSB, so I would just go
with that. :)

Brian

> Thanks,
> Jan
> 
> -- 
> Jan Tulak
> jtulak@xxxxxxxxxx / jan@xxxxxxxx

> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

<Prev in Thread] Current Thread [Next in Thread>