summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.c')
-rw-r--r--xlators/cluster/dht/src/dht-common.c57
1 files changed, 49 insertions, 8 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 9a8a161bd17..e41e17a2d4f 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -5038,20 +5038,33 @@ dht_mknod_linkfile_create_cbk (call_frame_t *frame, void *cookie,
struct iatt *preparent, struct iatt *postparent,
dict_t *xdata)
{
- dht_local_t *local = NULL;
- xlator_t *cached_subvol = NULL;
+ dht_local_t *local = NULL;
+ xlator_t *cached_subvol = NULL;
+ dht_conf_t *conf = NULL;
local = frame->local;
- if (op_ret == -1)
- goto err;
if (!local || !local->cached_subvol) {
op_errno = EINVAL;
goto err;
}
+ if (op_ret == -1)
+ goto err;
+
+ conf = this->private;
+ if (!conf) {
+ local->op_errno = EINVAL;
+ goto err;
+ }
+
cached_subvol = local->cached_subvol;
+ if (local->params) {
+ dict_del (local->params, conf->link_xattr_name);
+ dict_del (local->params, GLUSTERFS_INTERNAL_FOP_KEY);
+ }
+
STACK_WIND_COOKIE (frame, dht_newfile_cbk, (void *)cached_subvol,
cached_subvol, cached_subvol->fops->mknod,
&local->loc, local->mode, local->rdev, local->umask,
@@ -5059,8 +5072,13 @@ dht_mknod_linkfile_create_cbk (call_frame_t *frame, void *cookie,
return 0;
err:
- if (local->lock.locks)
+ if (local && local->lock.locks) {
local->refresh_layout_unlock (frame, this, -1);
+ } else {
+ DHT_STACK_UNWIND (mknod, frame, -1,
+ op_errno, NULL, NULL, NULL,
+ NULL, NULL);
+ }
return 0;
}
@@ -5836,26 +5854,49 @@ dht_create_linkfile_create_cbk (call_frame_t *frame, void *cookie,
struct iatt *preparent, struct iatt *postparent,
dict_t *xdata)
{
- dht_local_t *local = NULL;
- xlator_t *cached_subvol = NULL;
+ dht_local_t *local = NULL;
+ xlator_t *cached_subvol = NULL;
+ dht_conf_t *conf = NULL;
local = frame->local;
+ if (!local) {
+ op_errno = EINVAL;
+ goto err;
+ }
+
if (op_ret == -1) {
local->op_errno = op_errno;
goto err;
}
+ conf = this->private;
+ if (!conf) {
+ local->op_errno = EINVAL;
+ goto err;
+ }
+
cached_subvol = local->cached_subvol;
+ if (local->params) {
+ dict_del (local->params, conf->link_xattr_name);
+ dict_del (local->params, GLUSTERFS_INTERNAL_FOP_KEY);
+ }
+
STACK_WIND (frame, dht_create_cbk,
cached_subvol, cached_subvol->fops->create,
&local->loc, local->flags, local->mode,
local->umask, local->fd, local->params);
return 0;
+
err:
- if (local->lock.locks)
+ if (local && local->lock.locks) {
local->refresh_layout_unlock (frame, this, -1);
+ } else {
+ DHT_STACK_UNWIND (create, frame, -1,
+ op_errno, NULL, NULL, NULL,
+ NULL, NULL, NULL);
+ }
return 0;
}