diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2016-03-14 10:59:38 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-04-29 06:57:39 -0700 |
commit | b246b07896fefb261c9fb07f3f29f0d03b81b88d (patch) | |
tree | 90891fa20acd22529e2d2dcc53faec39e53134ea /xlators/cluster/dht/src/dht-common.c | |
parent | f8948e2c5ce3154f571c8ae16eb5804560e26590 (diff) |
dht/afr/client/posix: Fail mkdir without gfid-req
Do not allow directory creations without gfids as
after the directories are created, operations
on them fail anyway. So it is better to fail mkdir.
BUG: 1317361
Change-Id: I8f8e3b38bbded1960b7215bac0432500f7e78038
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/13690
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 3dea94d7376..01b6123d1b3 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -7346,6 +7346,14 @@ dht_mkdir (call_frame_t *frame, xlator_t *this, conf = this->private; + if (!params || !dict_get (params, "gfid-req")) { + op_errno = EPERM; + gf_msg_callingfn (this->name, GF_LOG_WARNING, op_errno, + DHT_MSG_GFID_NULL, "mkdir: %s is received " + "without gfid-req %p", loc->path, params); + goto err; + } + dht_get_du_info (frame, this, loc); local = dht_local_init (frame, loc, NULL, GF_FOP_MKDIR); |