2> /dev/null)
[ -z "$COUNT" -o -z "$SIZE" ] && UNLINK=""
+ SIZE=${LFS_SIZE_OPT}${SIZE}
fi
# first try to migrate inside lustre
# if failed go back to old rsync mode
if [[ $RSYNC_MODE == false ]]; then
- $LFS migrate -c${COUNT} ${LFS_SIZE_OPT}${SIZE} $OLDNAME
- if [[ $? == 0 ]]; then
+ if $LFS migrate -c${COUNT} ${SIZE} "$OLDNAME"; then
$ECHO "done"
continue
else
+ echo "falling back to rsync-based migration"
RSYNC_MODE=true
fi
fi
continue
fi
- [ "$UNLINK" ] && $LFS setstripe -c${COUNT} \
- ${LFS_SIZE_OPT}${SIZE} "$NEWNAME"
+ [ "$UNLINK" ] && $LFS setstripe -c${COUNT} ${SIZE} "$NEWNAME"
# we use --inplace, since we created our own temp file already
if ! $RSYNC -a --inplace $RSYNC_OPTS "$OLDNAME" "$NEWNAME";then
SWAP_LAYOUTS_KEEP_MTIME |
SWAP_LAYOUTS_KEEP_ATIME);
if (rc == -EAGAIN) {
- fprintf(stderr, "file dataversion for %s has changed"
- " during copy, migration is aborted\n",
- name);
+ fprintf(stderr, "%s: dataversion changed during copy, "
+ "migration aborted\n", name);
goto error;
}
if (rc != 0)
- fprintf(stderr, "cannot swap layouts between %s and "
- "a volatile file (%s)\n",
+ fprintf(stderr, "%s: swap layout to new file failed: %s\n",
name, strerror(-rc));
error: