mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-04 04:51:53 +00:00
[drivers/blk] 解决块设备写入不对齐数据失败的问题 #11103
This commit is contained in:
@@ -175,14 +175,16 @@ _goon:
|
||||
if ((count - wsize) / bytes_per_sector != 0)
|
||||
{
|
||||
res = rt_device_write(dev, blk_pos, buf + wsize, (count - wsize) / bytes_per_sector);
|
||||
wsize += res * bytes_per_sector;
|
||||
blk_pos += res;
|
||||
|
||||
if (res != (count - wsize) / bytes_per_sector)
|
||||
{
|
||||
wsize += res * bytes_per_sector;
|
||||
*pos += wsize;
|
||||
return wsize;
|
||||
}
|
||||
|
||||
wsize += res * bytes_per_sector;
|
||||
blk_pos += res;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user