scoutfs-utils: fix last data blkno

The calculation of the last valid data blkno was off by one.  It was
calculating the total number of small blocks that fit in the device
size.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2020-08-26 14:39:28 -07:00
committed by Zach Brown
parent 5f0dbc5f85
commit 9bb32b8003
+1 -1
View File
@@ -335,7 +335,7 @@ static int write_new_fs(char *path, int fd, u8 quorum_count)
last_meta = next_meta + ((size / 5) >> SCOUTFS_BLOCK_LG_SHIFT);
/* The rest of the device is data blocks */
first_data = (last_meta + 1) << SCOUTFS_BLOCK_SM_LG_SHIFT;
last_data = size >> SCOUTFS_BLOCK_SM_SHIFT;
last_data = (size >> SCOUTFS_BLOCK_SM_SHIFT) - 1;
/* partially initialize the super so we can use it to init others */
memset(super, 0, SCOUTFS_BLOCK_SM_SIZE);