lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 4 Aug 2009 15:58:44 -0400
From:	Valerie Aurora <vaurora@...hat.com>
To:	Andreas Dilger <adilger@....com>
Cc:	Theodore Tso <tytso@....edu>, Julia Lawall <julia@...u.dk>,
	linux-ext4@...r.kernel.org, Eric Sandeen <sandeen@...hat.com>,
	Ric Wheeler <rwheeler@...hat.com>,
	Jesper Andersen <jespera@...u.dk>
Subject: Re: spatch for 64-bit e2fsprogs (was Re: Fix device too big bug in mainline?)

On Tue, Aug 04, 2009 at 01:24:08PM -0600, Andreas Dilger wrote:
> Semantic patches...  a very interesting idea.
> 
> On Aug 04, 2009  14:18 -0400, Valerie Aurora wrote:
> > // Free blocks
> > -fs->group_desc[group].bg_free_blocks_count++
> > +ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group)+1)
> > |
> > -fs->group_desc[group].bg_free_blocks_count--
> > +ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group)-1)
> > |
> > -fs->group_desc[group].bg_free_blocks_count += i
> > +ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group)+i)
> > |
> > -fs->group_desc[group].bg_free_blocks_count -= i
> > +ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group)-i)
> 
> I wonder if it makes more sense for ext2fs to export functions like
> ext2fs_bg_free_blocks_count_add() and ext2fs_bg_free_blocks_count_sub()?

I am agnostic.

> > -fs->group_desc[group].bg_flags = 0
> > +ext2fs_bg_flags_clear(fs, group, 0)
> 
> This last one looks like an error.  To clear the flags you should
> use ext2fs_bg_flags_set(fs, group, 0), otherwise you are "clearing
> no flags".

The code does the right thing:

void ext2fs_bg_flags_clear(ext2_filsys fs, dgrp_t group, __u16 bg_flags)
{
        if (fs->super->s_desc_size >= EXT2_MIN_DESC_SIZE_64BIT) {
                struct ext4_group_desc *gdp;
                gdp = (struct ext4_group_desc *) (fs->group_desc) + group;

                gdp->bg_flags = 0;
                return;
        }

        fs->group_desc[group].bg_flags = 0;
}

The problem is that this function is stupidly named:

ext2fs_bg_flag_clear() - does what you think
ext2fs_bg_flags_clear() - does above
              ^

It should be removed and replaced by ext2fs_bg_flags_set(), I agree.

-VAL
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ