diff options
| author | Susant Palai <spalai@redhat.com> | 2014-09-10 21:34:37 +0530 | 
|---|---|---|
| committer | Niels de Vos <ndevos@redhat.com> | 2014-09-17 08:34:03 -0700 | 
| commit | 3f886a345d4cb0d4760cadd0ab5fd94c0b7209a6 (patch) | |
| tree | 34f505495a084bc277614f92779e90f364c3c86b | |
| parent | 97ada676f981705ebf2749327b5e2349e5028446 (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: 1139170
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>
(cherry picked from commit 52da727e7564963a8a244fc5cb7028315e458529)
Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/8715
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
| -rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 48 | 
1 files changed, 41 insertions, 7 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 57a1590e1ce..e2d6da2da81 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1493,12 +1493,25 @@ 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,                                         conf->xattr_name, 4 * 4); - +                if (ret) { +                        gf_log (this->name, GF_LOG_WARNING, +                                "Failed to set dictionary value:key = %s for " +                                "path %s", conf->xattr_name, 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, +                                       conf->link_xattr_name, 256); +                if (ret < 0) { +                        gf_log (this->name, GF_LOG_WARNING, +                                "Failed to set dictionary value:key = %s for " +                                "path %s", conf->link_xattr_name, loc->path); +                        goto err; +                }                  if (IA_ISDIR (local->inode->ia_type)) {                          local->call_cnt = call_cnt = conf->subvolume_cnt;                          for (i = 0; i < call_cnt; i++) { @@ -1516,7 +1529,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); @@ -1533,15 +1551,31 @@ dht_lookup (call_frame_t *frame, xlator_t *this,                  /* TODO: remove the hard-coding */                  ret = dict_set_uint32 (local->xattr_req,                                         conf->xattr_name, 4 * 4); +                if (ret) { +                        gf_log (this->name, GF_LOG_WARNING, +                                "Failed to set dictionary value:key = %s for " +                                "path %s", conf->xattr_name, loc->path); +                        goto err; +                }                  ret = dict_set_uint32 (local->xattr_req,                                         conf->link_xattr_name, 256); - +                if (ret) { +                        gf_log (this->name, GF_LOG_WARNING, +                                "Failed to set dictionary value:key = %s for " +                                "path %s", conf->link_xattr_name, 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);  | 
