mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
inode number might conflict (cherry picked from commit 37e92f4f6372d205a24f1dc7774786e727b13417)
This commit is contained in:
parent
10c9e17b66
commit
f8b9c5be35
@ -60,10 +60,9 @@ if [ `is_disk $DST_PATH` -eq 1 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DST_INODE=$(timeout 10 ssh "$DST_HOST" "ls -d -i \"$DST_DIR\" | awk '{print \$1}'")
|
||||
SRC_INODE=$(timeout 10 ssh "$SRC_HOST" "ls -d -i \"$SRC_DIR\" | awk '{print \$1}'")
|
||||
|
||||
if [ -n "$SRC_INODE" ] && [ -n "$DST_INODE" ] && [ "$SRC_INODE" = "$DST_INODE" ]; then
|
||||
RANDOM_FILE=$(ssh "$DST_HOST" "mktemp -p \"$DST_DIR\"")
|
||||
trap "ssh $DST_HOST \"rm -f $RANDOM_FILE\"" EXIT TERM INT HUP
|
||||
if ssh "$SRC_HOST" "test -f $RANDOM_FILE"; then
|
||||
log "Not moving $SRC to $DST, they are the same path"
|
||||
exit 0
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user