Fix an invalid assumption about allocated parity

In the copy detection it's possible to need to
copy from a file wihout parity. This could result
in the parity position not found.
This commit is contained in:
Andrea Mazzoleni 2016-01-15 19:50:21 +01:00
parent 2f5c6a39a9
commit 56bef0d90f
4 changed files with 47 additions and 29 deletions

View file

@ -941,6 +941,7 @@ block_off_t fs_file2par_get_ts(struct snapraid_disk* disk, struct snapraid_chunk
/**
* Get the parity position from the file position.
* Return POS_INVALID if no parity is allocated.
* \note This function is NOT thread-safe as it uses the the disk cache.
*/
static inline block_off_t fs_file2par_get(struct snapraid_disk* disk, struct snapraid_file* file, block_off_t file_pos)