ref: 46513990026f467c02bc405fcf7607ecac410900
parent: 16b7ebbb8f420dceb77baa18918ea5c7af0a156e
author: gkostka <kostka.grzegorz@gmail.com>
date: Sun Nov 15 17:57:32 EST 2015
Return success when 0 block read/write is called
--- a/blockdev/linux/ext4_filedev.c
+++ b/blockdev/linux/ext4_filedev.c
@@ -86,7 +86,8 @@
{
if (fseeko(dev_file, blk_id * bdev->ph_bsize, SEEK_SET))
return EIO;
-
+ if (!blk_cnt)
+ return EOK;
if (!fread(buf, bdev->ph_bsize * blk_cnt, 1, dev_file))
return EIO;
@@ -112,7 +113,8 @@
{
if (fseeko(dev_file, blk_id * bdev->ph_bsize, SEEK_SET))
return EIO;
-
+ if (!blk_cnt)
+ return EOK;
if (!fwrite(buf, bdev->ph_bsize * blk_cnt, 1, dev_file))
return EIO;