[dm-devel] block: Fix a WRITE SAME BUG_ON
Martin K. Petersen
martin.petersen at oracle.com
Tue Feb 19 23:10:39 UTC 2019
Hi Zhang,
> ping.
>
> Anyone can help merge this patch? or any other solutions?
+ /* If the logical block size is different, forbid write same */
+ if (t->logical_block_size != b->logical_block_size &&
+ t->max_write_same_sectors != UINT_MAX)
+ t->max_write_same_sectors = 0;
+ else
+ t->max_write_same_sectors = min(t->max_write_same_sectors,
+ b->max_write_same_sectors);
+
I am not particularly keen on this UINT_MAX magic. I would prefer to
have the stacking driver default for lbs be set to 0 so the stacking
function could avoid special-casing the first iteration. But I am not
sure whether that would break any assumptions in DM/MD wrt. the logical
block size being non-zero prior to calling the stacking function.
Mike? Any comments?
If we stick with the UINT_MAX check, the comment should at least point
out why it's there.
--
Martin K. Petersen Oracle Linux Engineering
More information about the dm-devel
mailing list