In the restore case of llapi_hsm_action_end() call fsync() on the
volatile file before updating its timestamps. This prevents spurious
{a,m,c}times from fsync(). Correct a related comment in sanity-hsm
test_24a().
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I982dfd49cbb7d6f9cd7d569e834e4e0581e4bdc9
Reviewed-on: http://review.whamcloud.com/19441
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
[ $ctime0 -eq $ctime1 ] ||
error "release changed ctime from $ctime0 to $ctime1"
[ $ctime0 -eq $ctime1 ] ||
error "release changed ctime from $ctime0 to $ctime1"
- # Restore should not change atime or mtime and should not
- # decrease ctime.
+ # Restore should not change any timestamps.
$LFS hsm_restore $file
wait_request_state $fid RESTORE SUCCEED
$LFS hsm_restore $file
wait_request_state $fid RESTORE SUCCEED
.lfu_ctime_nsec = hcp->stat.st_ctim.tv_nsec,
};
.lfu_ctime_nsec = hcp->stat.st_ctim.tv_nsec,
};
- /* Set {a,m,c}time of volatile file to that of original. */
- if (ioctl(hcp->data_fd, LL_IOC_FUTIMES_3, &lfu) < 0) {
+ rc = fsync(hcp->data_fd);
+ if (rc < 0) {
errval = -errno;
goto end;
}
errval = -errno;
goto end;
}
- rc = fsync(hcp->data_fd);
+ /* Set {a,m,c}time of volatile file to that of original. */
+ rc = ioctl(hcp->data_fd, LL_IOC_FUTIMES_3, &lfu);
if (rc < 0) {
errval = -errno;
goto end;
if (rc < 0) {
errval = -errno;
goto end;