Copying file to an OCFS2 file system using rsync result in wrong ownership of symlinks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ocfs2-tools (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Not sure if this should be filed against linux-meta (if it is an OCFS2 bug) or against rsync, so I left the package field blank.
When copying files to an OCFS2 filesystem using rsync, ownership of symlinks is not preserved correctly. Strangely, running rsync a second time would fix the ownership. This problem have been isolated to using rsync and OCFS2 in conjunction, as ownership of symlinks is preserved correctly on the same machine when either rsync'ing to an ext3 file system, or when copying to an OCFS2 volume using other means (such as cp). The symptoms have been observed in both gutsy and hardy.
uname -a: Linux ocfs2-hardy-node1 2.6.24-5-server #1 SMP Thu Jan 24 19:58:47 UTC 2008 x86_64 GNU/Linux
Steps to reproduce
-------
1. Install hardy, create an OCFS2 volume and mount it under /data (for example)
2. Setup a rsyncd server, and create a module where files, including synlinks, are not owned by root (owned by ftp:ftp in my example here)
3. rsync the files to your OCFS2 volume. the command line i use is:
sudo rsync -avz 192.168.
4. ls -l /data/rsync-test -> notice that file ownership are correct, except for symlinks which are owned by root:root instead of ftp:ftp as they should
5. Run the rsync command above a second time.
6. ls -l /data/rsync-test -> notice that all files, including symlinks, are now owned correctly by ftp:ftp
7. rsync to a location that is on an ext3 file system now (/home/test in this example)
sudo rsync -avz 192.168.
8. ls -l /home/test -> notice all file ownership are correct, including symlinks
9. Copy the file to the OCFS2 volume using some other mean (in this example, using cp from a NFS mount)
sudo rm -rf /data/rsync-test/*
sudo mount 192.168.1.10:/data /mnt
sudo cp -a /mnt/* /data/rsync-test/
10. ls -l /data/rsync-test -> notice all file ownership are correct, including symlinks
Changed in ocfs2: | |
status: | Unknown → Fix Released |
Changed in ocfs2: | |
importance: | Unknown → Medium |
i have also noticed a similar issue but mine is just with symlinks and ocfs in general:
say /opt is my mounted ocfs2 partition
node1:# ln -s /opt/blah /etc/issue
node1:# ls -lah /opt/blah
lrwxrwxrwx 1 root root 10 2008-04-15 22:26 /opt/blah -> /etc/issue
node2:# ls -lah /opt/blah
lrwxrwxrwx 1 root root 10 2008-04-15 22:26 /opt/blah -> /etc/issue
Then say i change the ownership of the symlink
node1:# chown -h user1 /opt/blah
node1:# ls -lah /opt/blah
lrwxrwxrwx 1 user1 root 10 2008-04-15 23:30 /opt/blah -> /etc/issue
But the ownership on any of the other nodes has not been updated:
node2:# ls -lah /opt/blah
lrwxrwxrwx 1 root root 10 2008-04-15 22:26 /opt/blah -> /etc/issue
This however is not the case with regular files, updating the ownership on a standard file is fine across all nodes