diff options
author | Guo Chao <[email protected]> | 2013-02-21 15:16:50 -0800 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2013-02-22 10:43:22 +0100 |
commit | b7a1da695f3fb33d093e6de20b1dfc238e3c9587 (patch) | |
tree | 396c68e51b16414c20b4ae2c61a421ab7d1739c6 /drivers/scsi/mpt2sas/mpi/mpi2_raid.h | |
parent | b1a6650406875b9097a032eed89af50682fe1160 (diff) |
loopdev: ignore negative offset when calculate loop device size
Negative offset may cause loop device size larger than backing file
size.
$ fallocate -l 1M a
$ losetup --offset 0xffffffffffff0000 /dev/loop0 a
$ blockdev --getsize64 /dev/loop0
1114112
$ ls -l a
-rw-r--r-- 1 root root 1048576 Jan 23 12:46 a
$ cat /dev/loop0
cat: /dev/loop0: Input/output error
It makes no sense to do that. Only apply offset when it's positive.
Fix a typo in the comment by the way.
Signed-off-by: Guo Chao <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Guo Chao <[email protected]>
Cc: M. Hindess <[email protected]>
Cc: Nikanth Karthikesan <[email protected]>
Cc: Jens Axboe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpi/mpi2_raid.h')
0 files changed, 0 insertions, 0 deletions