zvol: unsigned off can not be less than zero

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Toomas Soome <tsoome@me.com>
Closes #10867
This commit is contained in:
Toomas Soome 2020-09-02 19:30:29 +03:00 committed by GitHub
parent 417e646722
commit 0db1b84a6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -626,7 +626,7 @@ zvol_geom_bio_strategy(struct bio *bp)
addr = bp->bio_data; addr = bp->bio_data;
resid = bp->bio_length; resid = bp->bio_length;
if (resid > 0 && (off < 0 || off >= volsize)) { if (resid > 0 && off >= volsize) {
error = SET_ERROR(EIO); error = SET_ERROR(EIO);
goto resume; goto resume;
} }