diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2021-05-07 18:38:10 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2021-05-10 18:11:36 +0300 |
commit | 7ee06ddc4038f936b0d4459d37a7d4d844fb03db (patch) | |
tree | 031bf1397372f0c2f2d3180e16619578387f1c75 /drivers/ide/hpt366.c | |
parent | 6efb943b8616ec53a5e444193dccf1af9ad627b5 (diff) | |
download | linux-7ee06ddc4038f936b0d4459d37a7d4d844fb03db.tar.xz |
dm snapshot: fix a crash when an origin has no snapshots
If an origin target has no snapshots, o->split_boundary is set to 0.
This causes BUG_ON(sectors <= 0) in block/bio.c:bio_split().
Fix this by initializing chunk_size, and in turn split_boundary, to
rounddown_pow_of_two(UINT_MAX) -- the largest power of two that fits
into "unsigned" type.
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/ide/hpt366.c')
0 files changed, 0 insertions, 0 deletions