diff options
author | Amar Tumballi <amar@gluster.com> | 2010-09-22 09:43:45 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-22 08:23:01 -0700 |
commit | 435603caeb651dc1050c85281e3838df9d37ce64 (patch) | |
tree | d002ba0da708ec7b098db27a3d6ab2e617f52f8e /xlators/cluster/dht/src/dht-linkfile.c | |
parent | 66b1613efdae3ba2740241ee325e5f0b0634424d (diff) |
distribute: in linkfile creation check for valid gfid in inode
* if inode->gfid is not valid (ie, null), take the gfid from the
parameter dictionary passed from higher layer
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1565 (deleting files after dht rebalance)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1565
Diffstat (limited to 'xlators/cluster/dht/src/dht-linkfile.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-linkfile.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c index 1ecae5dfd..fa84ea29e 100644 --- a/xlators/cluster/dht/src/dht-linkfile.c +++ b/xlators/cluster/dht/src/dht-linkfile.c @@ -123,21 +123,21 @@ dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk, local->linkfile.srcvol = tovol; loc_copy (&local->linkfile.loc, loc); - dict = dict_new (); - if (!dict) - goto out; - - ret = dict_set_static_bin (dict, "gfid-req", loc->inode->gfid, 16); - if (ret) - gf_log ("dht-linkfile", GF_LOG_DEBUG, "gfid set failed"); + if (!uuid_is_null (loc->inode->gfid)) { + dict = dict_new (); + if (!dict) + goto out; + ret = dict_set_static_bin (dict, "gfid-req", loc->inode->gfid, 16); + if (ret) + gf_log ("dht-linkfile", GF_LOG_DEBUG, "gfid set failed"); + } else if (local->params) { + dict = dict_ref (local->params); + } STACK_WIND (frame, dht_linkfile_create_cbk, fromvol, fromvol->fops->mknod, loc, S_IFREG | DHT_LINKFILE_MODE, 0, dict); - if (dict) - dict_unref (dict); - return 0; out: local->linkfile.linkfile_cbk (frame, NULL, frame->this, -1, ENOMEM, |