mirror of
https://github.com/versity/scoutfs.git
synced 2026-08-27 19:36:52 +00:00
Fix EOF extent in last block
Currently if there is an extent on the last block the code will only set EOF on ENOENT. In the case that the last block has an extent it wont go to the next iteration due to iblock <= last. This then doesnt set the EOF on the last block in these cases. We want to just allow the loop to keep looping and rely on if (ext.start > last) to protect us from infinite loop.
This commit is contained in:
+4
-3
@@ -1748,13 +1748,14 @@ int scoutfs_data_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
|
||||
iblock = start >> SCOUTFS_BLOCK_SM_SHIFT;
|
||||
last = (start + len - 1) >> SCOUTFS_BLOCK_SM_SHIFT;
|
||||
|
||||
while (iblock <= last) {
|
||||
while (true) {
|
||||
ret = scoutfs_ext_next(sb, &data_ext_ops, &args,
|
||||
iblock, 1, &ext);
|
||||
if (ret < 0) {
|
||||
if (ret == -ENOENT)
|
||||
if (ret == -ENOENT) {
|
||||
ret = 0;
|
||||
last_flags = FIEMAP_EXTENT_LAST;
|
||||
last_flags = FIEMAP_EXTENT_LAST;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user