[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1628392 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

From: Stefan Fuhrmann <stefan.fuhrmann_at_wandisco.com>
Date: Tue, 30 Sep 2014 16:51:55 +0200

On Tue, Sep 30, 2014 at 2:35 PM, Branko Čibej <brane_at_wandisco.com> wrote:

> On 30.09.2014 12:51, stefan2_at_apache.org wrote:
> > Author: stefan2
> > Date: Tue Sep 30 10:51:51 2014
> > New Revision: 1628392
> >
> > URL: http://svn.apache.org/r1628392
> > Log:
> > Some of our FSFS config settings will cause malfunction if invalid
> > values were given. Thus, sanitize them before using them.
> >
> > * subversion/libsvn_fs_fs/fs_fs.c
> > (sanitize_block_size): New function to verify config data.
> > (read_config): Use the new function to guarantee valid settings
> > in our FS struct.
> >
> > Modified:
> > subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
> >
> > Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
> > URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1628392&r1=1628391&r2=1628392&view=diff
> >
> ==============================================================================
> > --- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
> > +++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Tue Sep 30 10:51:51
> 2014
> > @@ -644,6 +644,41 @@ svn_fs_fs__fs_supports_mergeinfo(svn_fs_
> > return ffd->format >= SVN_FS_FS__MIN_MERGEINFO_FORMAT;
> > }
> >
> > +/* Check that BLOCK_SIZE is a valid block / page size, i.e. it is within
> > + * the range of what the current system may address in RAM and it is a
> > + * power of 2. Assume that the element size within the block is
> ITEM_SIZE.
> > + */
> > +static svn_error_t *
> > +verify_block_size(apr_int64_t block_size,
> > + apr_size_t item_size,
> > + const char *name)
> > +{
> > + /* Limit range. */
> > + if (block_size <= 0)
> > + return svn_error_createf(SVN_ERR_BAD_CONFIG_VALUE, NULL,
> > + _("%" APR_INT64_T_FMT " is too small for "
> > + "fsfs.conf setting '%s'."),
> > + block_size, name);
>
>
> We determined a while ago that this kind of format pattern causes
> headaches for translators, because APR_INT64_T_FMT et al. are
> platform-specific.
>

You are right! Thanks for the review.

I forget what we decided to do instead ... search the archives, there's
> a solution in them somewhere.
>

Nearby instances convert to string before using it in the formatted
output. I did that with the new code in r1628427.

-- Stefan^2.
Received on 2014-09-30 16:52:30 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.