Project

General

Profile

Actions

Backport #9567

closed

FileUtils.mv cannot move to an NFS directory when the source contains a relative symlink

Added by aparker42 (Andrew Parker) about 8 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:61089]

Description

root@local-gravityapple:/home/www# mkdir /tmp/testing
root@local-gravityapple:/home/www# cd /tmp/testing
root@local-gravityapple:/tmp/testing# echo "file" > file
root@local-gravityapple:/tmp/testing# ln -s file link
root@local-gravityapple:/tmp/testing# ls -l
total 4
-rw-r--r-- 1 root root 5 Feb 25 19:01 file
lrwxrwxrwx 1 root root 4 Feb 25 19:01 link -> file
root@local-gravityapple:/tmp/testing# cd -
/home/www
root@local-gravityapple:/home/www# ruby -rfileutils -e 'FileUtils.mv("/tmp/testing", "/home/www")'
/usr/lib/ruby/1.9.1/fileutils.rb:1379:in `utime': No such file or directory - /home/www/testing/link (Errno::ENOENT)
from /usr/lib/ruby/1.9.1/fileutils.rb:1379:in `copy_metadata'
from /usr/lib/ruby/1.9.1/fileutils.rb:466:in `block in copy_entry'
from /usr/lib/ruby/1.9.1/fileutils.rb:1433:in `preorder_traverse'
from /usr/lib/ruby/1.9.1/fileutils.rb:462:in `copy_entry'
from /usr/lib/ruby/1.9.1/fileutils.rb:521:in `rescue in block in mv'
from /usr/lib/ruby/1.9.1/fileutils.rb:518:in `block in mv'
from /usr/lib/ruby/1.9.1/fileutils.rb:1515:in `block in fu_each_src_dest'
from /usr/lib/ruby/1.9.1/fileutils.rb:1529:in `fu_each_src_dest0'
from /usr/lib/ruby/1.9.1/fileutils.rb:1513:in `fu_each_src_dest'
from /usr/lib/ruby/1.9.1/fileutils.rb:508:in `mv'
from -e:1:in `'
root@local-gravityapple:/home/www# ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
root@local-gravityapple:/home/www# cat /etc/debian_version
7.0

If the same exercise is done, but the link symlink is made as using the absolute path (/tmp/testing/file) then FileUtils.mv succeeds. This only seems to affect NFS mounts. Moving to a non-NFS mounted location with the relative link works.

It seems that it is copying the link first and then failing while trying to resolve the copied link. The destination location contains the symlink:

root@local-gravityapple:/home/www# ls -l testing/
total 4
lrwxrwxrwx 1 504 dialout 4 Feb 25 19:02 link -> file

Updated by nobu (Nobuyoshi Nakada) about 8 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193

Fixed by r35499.

Actions #2

Updated by jeremyevans0 (Jeremy Evans) almost 3 years ago

  • Status changed from Open to Closed

Updated by Anonymous over 2 years ago

  • Description updated (diff)

Updated by Anonymous over 2 years ago

  • File furniture.jfif added

Updated by Anonymous over 2 years ago

  • Subject changed from FileUtils.mv cannot move to an NFS directory when the source contains a relative symlink to Best Home Furniture Brands
  • Project changed from Backport193 to Backport186
Actions #6

Updated by Anonymous over 2 years ago

  • File deleted (furniture.jfif)
Actions #7

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Subject changed from Best Home Furniture Brands to FileUtils.mv cannot move to an NFS directory when the source contains a relative symlink
  • Project changed from Backport186 to Backport193
Actions #8

Updated by hsbt (Hiroshi SHIBATA) over 2 years ago

  • Description updated (diff)
Actions

Also available in: Atom PDF