summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2014-07-09 09:31:45 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2014-10-20 07:53:33 -0700
commit3042613687d976c4e8938fb411cedc6e6ef559bf (patch)
treee999dc4525612ef6453cd2f001c885ddfbbcd58a
parenta7356806f9f7c148d4e0a972f6a418d1ca82bcd0 (diff)
DHT/Create : Failing to identify a linkto file in lookup_everywhere_cbk path
In case a file is not found in its cached subvol we proceed with dht_lookup_everywhere. But as we dont add the linkto xattr to the dictionary, we fail to identify any linkto file encountered.The implication being we end up thinking the linkto file as a regular file and proceed with the fop. Change-Id: Iab02dc60e84bb1aeab49182f680c0631c33947e2 BUG: 1139992 Signed-off-by: Susant Palai <spalai@redhat.com> Reviewed-on: http://review.gluster.org/8277 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-on: http://review.gluster.org/8673 Reviewed-by: N Balachandran <nbalacha@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-common.c48
1 files changed, 43 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 29a63437f7b..5f7996a9ad6 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -1470,11 +1470,27 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
local->inode = inode_ref (loc->inode);
- /* NOTE: we don't require 'trusted.glusterfs.dht.linkto' attribute,
- * revalidates directly go to the cached-subvolume.
- */
ret = dict_set_uint32 (local->xattr_req,
"trusted.glusterfs.dht", 4 * 4);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:"
+ "key = trusted.glusterfs.dht for "
+ "path %s", loc->path);
+ goto err;
+ }
+
+ /* need it in case file is not found on cached file
+ * on revalidate path and we may encounter linkto files on
+ * with dht_lookup_everywhere*/
+ ret = dict_set_uint32 (local->xattr_req, DHT_LINKFILE_KEY, 256);
+ if (ret < 0) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:"
+ "key = %s for "
+ "path %s", DHT_LINKFILE_KEY, loc->path);
+ goto err;
+ }
if (IA_ISDIR (local->inode->ia_type)) {
local->call_cnt = call_cnt = conf->subvolume_cnt;
@@ -1493,7 +1509,12 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
'in-migration' state */
ret = dict_set_uint32 (local->xattr_req,
GLUSTERFS_OPEN_FD_COUNT, 4);
-
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:key = %s for "
+ "path %s", GLUSTERFS_OPEN_FD_COUNT, loc->path);
+ goto err;
+ }
/* need it for dir self-heal */
dht_check_and_set_acl_xattr_req (loc->inode, local->xattr_req);
@@ -1510,15 +1531,32 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
/* TODO: remove the hard-coding */
ret = dict_set_uint32 (local->xattr_req,
"trusted.glusterfs.dht", 4 * 4);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:key = %s for "
+ "path %s", "trusted.glusterfs.dht", loc->path);
+ goto err;
+ }
ret = dict_set_uint32 (local->xattr_req,
DHT_LINKFILE_KEY, 256);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:key = %s for "
+ "path %s", DHT_LINKFILE_KEY, loc->path);
+ goto err;
+ }
/* need it for self-healing linkfiles which is
'in-migration' state */
ret = dict_set_uint32 (local->xattr_req,
GLUSTERFS_OPEN_FD_COUNT, 4);
-
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to set dictionary value:key = %s for "
+ "path %s", GLUSTERFS_OPEN_FD_COUNT, loc->path);
+ goto err;
+ }
/* need it for dir self-heal */
dht_check_and_set_acl_xattr_req (loc->inode, local->xattr_req);