[Gluster-users] 2.0.0rc7 can not remove symbol-links

Anand Avati avati at gluster.com
Thu Mar 26 10:55:04 UTC 2009


Yes, this is being fixed as I write.

Avati

On Thu, Mar 26, 2009 at 4:18 PM, Kirby Zhou <kirbyzhou at sohu-rd.com> wrote:
> It seems a bad modification.
> If a bad symbol link exist, something error happens.
>
> http://git.savannah.gnu.org/cgit/gluster.git/commit/?id=4e5c297d7c3480d0d3ab
> 1c0c2a184c6a4fb801ef
>
> diff --git a/xlators/storage/posix/src/posix.c
> b/xlators/storage/posix/src/posix.c
> index 534db05..c20c7fe 100644
> --- a/xlators/storage/posix/src/posix.c
> +++ b/xlators/storage/posix/src/posix.c
> @@ -853,6 +853,7 @@ posix_unlink (call_frame_t *frame, xlator_t *this,
>         int32_t op_ret    = -1;
>         int32_t op_errno  = 0;
>         char *  real_path = NULL;
> +        int32_t fd = -1;
>
>         DECLARE_OLD_FS_ID_VAR;
>
> @@ -863,6 +864,15 @@ posix_unlink (call_frame_t *frame, xlator_t *this,
>         SET_FS_ID (frame->root->uid, frame->root->gid);
>         MAKE_REAL_PATH (real_path, this, loc->path);
>
> +        fd = open (real_path, O_RDONLY);
> +        if (fd == -1) {
> +                op_ret = -1;
> +                op_errno = errno;
> +                gf_log (this->name, GF_LOG_WARNING,
> +                        "open of %s failed: %s", loc->path, strerror
> (op_errno));
> +                goto out;
> +        }
> +
>         op_ret = unlink (real_path);
>         if (op_ret == -1) {
>                 op_errno = errno;
> @@ -876,8 +886,13 @@ posix_unlink (call_frame_t *frame, xlator_t *this,
>  out:
>         SET_TO_OLD_FS_ID ();
>         frame->root->rsp_refs = NULL;
> +
>         STACK_UNWIND (frame, op_ret, op_errno);
>
> +        if (fd != -1) {
> +                close (fd);
> +        }
> +
>         return 0;
>  }
>
>
> -----Original Message-----
> From: gluster-users-bounces at gluster.org
> [mailto:gluster-users-bounces at gluster.org] On Behalf Of Kirby Zhou
> Sent: Thursday, March 26, 2009 6:18 PM
> To: gluster-users at gluster.org
> Subject: [Gluster-users] 2.0.0rc7 can not remove symbol-links
>
> 2.0.0rc7 can not remove symbol-links
>
> [root at xen-727057 ~]# mount.glusterfs ~/x.vol /mnt/
> [root at xen-727057 ~]# ll /mnt/
> log/      rpmbuild/ wxp/      XXX/
> [root at xen-727057 ~]# ll /mnt/XXX/
> total 0
> lrwxrwxrwx 1 root root 1 Mar 26 18:13 X -> y
> [root at xen-727057 ~]# rm /mnt/XXX/X
> rm: remove symbolic link `/mnt/XXX/X'? y
> rm: cannot remove `/mnt/XXX/X': No such file or directory
>
>
> With a simple volume:
>
> #server
> volume brick1-posix
>  type storage/posix                   # POSIX FS translator
>  option directory /exports/disk1      # Export this directory
> end-volume
> volume brick1-locks
>  type features/locks
>  subvolumes brick1-posix
> end-volume
> volume brick1
>  type performance/io-threads
>  subvolumes brick1-locks
>  option thread-count 16
>  option cache-size 256m
> end-volume
>
> ### Add network serving capability to above brick.
> volume server
>  type protocol/server
>  option transport-type tcp/server     # For TCP/IP transport
>  option listen-port 6986              # Default is 6996
>  option client-volume-filename /etc/glusterfs/glusterfs.vol
>  subvolumes brick1
>  option auth.ip.brick1.allow 10.10.*,10.11.*,10.15.*,192.168.*
> end-volume
>
> #client
> volume 10.10.123.17-brick1
>  type protocol/client
>  option transport-type tcp/client
>  option remote-host 10.10.123.17
>  option remote-port 6986
>  option transport-timeout 5
>  option remote-subvolume brick1
> end-volume
>
> FYI
>
>
>
>
> _______________________________________________
> Gluster-users mailing list
> Gluster-users at gluster.org
> http://zresearch.com/cgi-bin/mailman/listinfo/gluster-users
>
>
>
> _______________________________________________
> Gluster-users mailing list
> Gluster-users at gluster.org
> http://zresearch.com/cgi-bin/mailman/listinfo/gluster-users
>




More information about the Gluster-users mailing list