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, 04 Aug 2009 13:24:08 -0600
From:	Andreas Dilger <adilger@....com>
To:	Valerie Aurora <vaurora@...hat.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?)

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()?

> -fs->group_desc[group].bg_flags & flag
> +ext2fs_bg_flag_test(fs, group, flag)
> |
> -fs->group_desc[group].bg_flags &= ~flag
> +ext2fs_bg_flag_clear(fs, group, flag)
> |
> -fs->group_desc[group].bg_flags |= flag
> +ext2fs_bg_flag_set(fs, group, flag)
> |
> -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".


Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

--
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