scoutfs: fix setattr offline extent length

We miscalculated the length of extents to create when initializing
offline extents for setattr_more.  We were clamping the extent length in
each packed extent item by the full size of the offline extent, ignoring
the iblock position that we were starting from.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2020-04-01 09:40:15 -07:00
committed by Zach Brown
parent 6228f7cde7
commit 6ae0ac936c

View File

@@ -1572,7 +1572,7 @@ int scoutfs_data_init_offline_extent(struct inode *inode, u64 size,
if (ret < 0)
goto out;
count = min(blocks, last_iblock(iblock) - iblock + 1);
count = min(blocks - iblock, last_iblock(iblock) - iblock + 1);
ret = set_extent(sb, inode, ino, unpe, iblock, 0, count,
SEF_OFFLINE);