[Gluster-devel] posix: symlink broken?
Rajesh Amaravathi
rajesh at redhat.com
Thu Oct 11 07:26:27 UTC 2012
This is how it should work, but for you requirements, you could cd (or chdir) into that directory and create a symlink:
cd /media
ln -s file link
this should give you an ls -la /media of:
lrwxrwxrwx 1 root root 1 Oct 11 12:51 link -> file
this way, even when you mount the volume on other mount points, the "link" will always refer to "file"
Regards,
Rajesh Amaravathi,
Software Engineer, GlusterFS
RedHat Inc.
----- Original Message -----
From: "M. Mohan Kumar" <mohan at in.ibm.com>
To: gluster-devel at nongnu.org
Sent: Thursday, October 11, 2012 11:35:47 AM
Subject: [Gluster-devel] posix: symlink broken?
As part of BD xlator symlink interface testing, I figured out that the
parameter 'linkname' contains even the mount point for example
'/media/link'. I wonder we should never get the mount directory in the
server part of code.
I tested creating symlink with posix xlator with top git commit
751da4675cf3add21e567aebb92de2c10457afee.
Here is the steps I followed:
[root at host mohan]# mount -t glusterfs host:/posix /media
[root at host mohan]# ls -la /media/
total 8
drwx------. 3 root root 4096 Oct 11 11:15 .
dr-xr-xr-x. 20 root root 4096 Sep 28 16:40 ..
[root at host mohan]# touch /media/file
[root at host mohan]# ln -s /media/file /media/link
[root at host mohan]# ls -la /media/
total 9
drwx------. 3 root root 4096 Oct 11 11:18 .
dr-xr-xr-x. 20 root root 4096 Sep 28 16:40 ..
-rw-r--r--. 1 root root 0 Oct 11 11:18 file
lrwxrwxrwx. 1 root root 11 Oct 11 11:18 link -> /media/file
[root at host mohan]# umount /media
[root at host mohan]# mount -t glusterfs host:/posix /media/posix
[root at host mohan]# ls -la /media/posix/
total 9
drwx------. 3 root root 4096 Oct 11 11:18 .
drwxr-xr-x. 4 root root 4096 Oct 11 07:55 ..
-rw-r--r--. 1 root root 0 Oct 11 11:18 file
lrwxrwxrwx. 1 root root 11 Oct 11 11:18 link -> /media/file
Directory listing of brick from server side
[root at host mohan]# ls -la ~/gl/posix/
total 24
drwx------. 3 root root 4096 Oct 11 11:18 .
drwx------. 4 root root 4096 Sep 28 20:20 ..
-rw-r--r--. 2 root root 0 Oct 11 11:18 file
drw-------. 12 root root 4096 Oct 11 11:18 .glusterfs
lrwxrwxrwx. 2 root root 11 Oct 11 11:18 link -> /media/file
Ideally it should be link -> file instead of /media/file
When I remounted with a different directory symlink is broken. Ideally
it should not create symlink with client mount directory details or am I
missing some thing here?
_______________________________________________
Gluster-devel mailing list
Gluster-devel at nongnu.org
https://lists.nongnu.org/mailman/listinfo/gluster-devel
More information about the Gluster-devel
mailing list