mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-05 06:10:13 -05:00
Clarify metadata validation semantics in sync comments
This commit is contained in:
parent
299ed704b5
commit
0483de15d2
1 changed files with 12 additions and 6 deletions
|
|
@ -187,7 +187,10 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
|
||||||
/* LCOV_EXCL_STOP */
|
/* LCOV_EXCL_STOP */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if the file is changed */
|
/*
|
||||||
|
* Check if the file changed between scan and open. Stat info is cached
|
||||||
|
* on open; further changes will be detected in the next sync by mtime.
|
||||||
|
*/
|
||||||
if (handle[j].st.st_size != file->size
|
if (handle[j].st.st_size != file->size
|
||||||
|| handle[j].st.st_mtime != file->mtime_sec
|
|| handle[j].st.st_mtime != file->mtime_sec
|
||||||
|| STAT_NSEC(&handle[j].st) != file->mtime_nsec
|
|| STAT_NSEC(&handle[j].st) != file->mtime_nsec
|
||||||
|
|
@ -209,8 +212,8 @@ static int state_hash_process(struct snapraid_state* state, block_off_t blocksta
|
||||||
++soft_error;
|
++soft_error;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the file is changed, it means that it was modified during sync
|
* File changed between scan and open; this isn't a serious error,
|
||||||
* this isn't a serious error, so we skip this block, and continue with others
|
* so we skip this block, and continue with others
|
||||||
*/
|
*/
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -562,7 +565,10 @@ static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_tas
|
||||||
/* LCOV_EXCL_STOP */
|
/* LCOV_EXCL_STOP */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if the file is changed */
|
/*
|
||||||
|
* Check if the file changed between scan and open. Stat info is cached
|
||||||
|
* on open; further changes will be detected in the next sync by mtime.
|
||||||
|
*/
|
||||||
if (handle->st.st_size != task->file->size
|
if (handle->st.st_size != task->file->size
|
||||||
|| handle->st.st_mtime != task->file->mtime_sec
|
|| handle->st.st_mtime != task->file->mtime_sec
|
||||||
|| STAT_NSEC(&handle->st) != task->file->mtime_nsec
|
|| STAT_NSEC(&handle->st) != task->file->mtime_nsec
|
||||||
|
|
@ -580,8 +586,8 @@ static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_tas
|
||||||
log_error_errno(ENOENT, disk->name); /* same message for ENOENT */
|
log_error_errno(ENOENT, disk->name); /* same message for ENOENT */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the file is changed, it means that it was modified during sync
|
* File changed between scan and open; this isn't a serious error,
|
||||||
* this isn't a serious error, so we skip this block, and continue with others
|
* so we skip this block, and continue with others
|
||||||
*/
|
*/
|
||||||
task->state = TASK_STATE_ERROR_CONTINUE;
|
task->state = TASK_STATE_ERROR_CONTINUE;
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue