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] [day] [month] [year] [list]
Message-ID: <20190819050917.GD10349@mit.edu>
Date:   Mon, 19 Aug 2019 01:09:17 -0400
From:   "Theodore Y. Ts'o" <tytso@....edu>
To:     Dongyang Li <dongyangli@....com>
Cc:     "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>,
        "adilger@...ger.ca" <adilger@...ger.ca>
Subject: Re: [PATCH 2/2] mke2fs: set overhead in super block for bigalloc

On Fri, Aug 16, 2019 at 03:49:14AM +0000, Dongyang Li wrote:
> Fix a bug in handle_bad_blocks(), don't covert the bad block to
> cluster when marking it as used, the bitmap is still a block bitmap,
> will be coverted to cluster bitmap later.

Please separate the bug fix into a separate commit.

> Note: in kernel the overhead is the s_overhead_clusters field from
> struct ext4_super_block, it's named s_overhead_blocks in e2fsprogs

Please fix up the field name in e2fsprogs, again in a separate commit.

> +errcode_t ext2fs_convert_subcluster_bitmap_overhead(ext2_filsys fs,
> +						    ext2fs_block_bitmap *bitmap,
> +						    badblocks_list bb_list,
> +						    unsigned int *count);

So I really hate this abstraction which you've proposed.  It's very
mke2fs specific, and mixing the bb_list abstraction into bitmap is
just really ugly.

Instead let me suggest the following:

1) Have mke2fs unset the blocks in bb_list from the block bitmap.
2) Then have mke2fs call ext2fs_convert_subcluster_bitmap()
3) Create an abstraction which counts the number of clusters in the
   bitmap, by using find_first_set() and first_first_zero().
4) Let mke2fs call that function defined in (3) above on the
   converted cluster bitmap() to get the overhead in clusters
5) Iterate over the bb_list to set the clusters in the converted
   cluster-granularity allocation map.

The abstraction in (3) is much less mke2fs specific, and if you make
the abstraction take a starting and ending block count, there are
potentially other use cases (for example, counting the number of
clusters in use in a block group).

Cheers,

					- Ted

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ