[drivers/blk] 解决块设备写入不对齐数据失败的问题 #11103

This commit is contained in:
AngryProton
2026-01-12 17:14:59 +08:00
committed by GitHub
parent 68a5c6a83b
commit f4566f14dc

View File

@@ -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;
}
/*