Re: 3.4.0beta2 crash in conservative merge?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Emmanuel Dreyfus <manu@xxxxxxxxxx> wrote:

> The others function calls in  dht_migration_complete_check_task() takes
> care of not using local->fd if local->loc.inode is not NULL. Only the
> offending code fails to do so:
> 
>         if (local->loc.inode) {
>                 ret = syncop_open (dst_node, &local->loc,
>                                    local->fd->flags, local->fd);
>         }

This leads me to trying the patch below. Comments are welcome.

--- xlators/cluster/dht/src/dht-helper.c.orig
+++ xlators/cluster/dht/src/dht-helper.c
@@ -813,20 +813,23 @@ dht_migration_complete_check_task (void 
          */
         SYNCTASK_SETID(0, 0);
         /* if 'local->fd' (ie, fd based operation), send a 'open()' on
            destination if not already done */
-        if (local->loc.inode) {
-                ret = syncop_open (dst_node, &local->loc,
-                                   local->fd->flags, local->fd);
-        } else {
+        if (!local->loc.inode) {
                 tmp_loc.inode = local->fd->inode;
                 inode_path (local->fd->inode, NULL, &path);
                 if (path)
                         tmp_loc.path = path;
                 ret = syncop_open (dst_node, &tmp_loc,
                                    local->fd->flags, local->fd);
                 GF_FREE (path);
-
+        } else {
+                if (local->fd)
+                        ret = syncop_open (dst_node, &local->loc,
+                                           local->fd->flags, local->fd);
+                else
+                        ret = syncop_open (dst_node, &local->loc,
+                                           O_RDWR, NULL);
         }
         SYNCTASK_SETID (frame->root->uid, frame->root->gid);
         if (ret == -1) {
                 gf_log (this->name, GF_LOG_ERROR,




-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@xxxxxxxxxx



[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux