mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-06 12:06:26 +00:00
Allow punch-offline to punch regions properly.
The current code here only works if the passed in start block is exactly the start of an offline extent. On top of that, it only will punch a single extent, ever, due to the test used after finding an extent. The reason is that we break the loop if the start isn't exactly the first block of the extent, even if the last block of the extent is within the wanted hole. With this change, it doesn't matter if the start is either part of an offline extent, or a hole, and, we can punch holes that encompass multiple extents separated by holes, punching all of them away. Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
@@ -1560,7 +1560,7 @@ int scoutfs_data_punch_offline(struct inode *inode, u64 iblock, u64 last, u64 da
|
||||
|
||||
for (i = 0; i < 32 && (iblock <= last); i++) {
|
||||
ret = scoutfs_ext_next(sb, &data_ext_ops, &args, iblock, 1, &ext);
|
||||
if (ret == -ENOENT || ext.start > iblock) {
|
||||
if (ret == -ENOENT || ext.start > last) {
|
||||
iblock = last + 1;
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user