[dm-devel] Re: [PATCH] dm snapshot: don't use zero chunksize

Alasdair G Kergon agk at redhat.com
Wed Oct 7 23:36:31 UTC 2009


On Tue, Oct 06, 2009 at 07:01:37PM -0400, Mikulas Patocka wrote:
> Under some special conditions (too big chunk size or zero-sized device),
> the resulting hash_size is calculated as zero.
> 
> rounddown_pow_of_two(0) is undefined operation (it expands to shift by -1).
> And init_exception_table with zero argument would fail with -ENOMEM.
> 
> This patch makes minimum chunk size 64, just like for pending exception table.
 
Could we have some more specific information in this patch header?

How does a "too big" chunk size happen?  And what is "too big"?

How does a zero-sized device happen and how can this code do anything
sensible if it encounters one - shouldn't it fail with an error instead?
Or do we still have a problem with the sequence in which dm ioctls are being
issued?

Alasdairs




More information about the dm-devel mailing list