diff options
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.h | 2 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-helper.c | 2 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-inode-read.c | 9 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-inode-write.c | 6 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-layout.c | 1 |
5 files changed, 12 insertions, 8 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index e220f554c00..d1d6032540d 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -331,6 +331,8 @@ typedef enum { } \ } while (0) +#define dht_inode_missing(op_errno) (op_errno == ENOENT || op_errno == ESTALE) + #define check_is_dir(i,s,x) (IA_ISDIR(s->ia_type)) #define layout_is_sane(layout) ((layout) && (layout->cnt > 0)) diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index ef29e3f3a8c..552b1597884 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -719,7 +719,7 @@ dht_migration_complete_check_task (void *data) dst_node = dht_linkfile_subvol (this, NULL, NULL, dict); if (ret) { - if ((errno != ENOENT) || (!local->loc.inode)) { + if (!dht_inode_missing(errno) || (!local->loc.inode)) { gf_log (this->name, GF_LOG_ERROR, "%s: failed to get the 'linkto' xattr %s", local->loc.path, strerror (errno)); diff --git a/xlators/cluster/dht/src/dht-inode-read.c b/xlators/cluster/dht/src/dht-inode-read.c index f17cb73b97c..1b05f18a4af 100644 --- a/xlators/cluster/dht/src/dht-inode-read.c +++ b/xlators/cluster/dht/src/dht-inode-read.c @@ -35,7 +35,7 @@ dht_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, prev = cookie; local->op_errno = op_errno; - if ((op_ret == -1) && (op_errno != ENOENT)) { + if ((op_ret == -1) && !dht_inode_missing(op_errno)) { gf_log (this->name, GF_LOG_DEBUG, "subvolume %s returned -1 (%s)", prev->this->name, strerror (op_errno)); @@ -143,7 +143,7 @@ dht_file_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; prev = cookie; - if ((op_ret == -1) && (op_errno != ENOENT)) { + if ((op_ret == -1) && !dht_inode_missing(op_errno)) { local->op_errno = op_errno; gf_log (this->name, GF_LOG_DEBUG, "subvolume %s returned -1 (%s)", @@ -393,7 +393,7 @@ dht_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local->call_cnt != 1) goto out; - if ((op_ret == -1) && (op_errno != ENOENT)) + if ((op_ret == -1) && !dht_inode_missing(op_errno)) goto out; if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2 (stbuf)) { @@ -706,7 +706,8 @@ dht_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, prev = cookie; local->op_errno = op_errno; - if (op_ret == -1) { + + if (op_ret == -1 && !dht_inode_missing(op_errno)) { gf_log (this->name, GF_LOG_DEBUG, "subvolume %s returned -1 (%s)", prev->this->name, strerror (op_errno)); diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c index 5e85ca536af..a0271842841 100644 --- a/xlators/cluster/dht/src/dht-inode-write.c +++ b/xlators/cluster/dht/src/dht-inode-write.c @@ -28,7 +28,7 @@ dht_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, dht_local_t *local = NULL; int ret = -1; - if (op_ret == -1) { + if (op_ret == -1 && !dht_inode_missing(op_errno)) { goto out; } @@ -178,7 +178,7 @@ dht_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; prev = cookie; - if ((op_ret == -1) && (op_errno != ENOENT)) { + if ((op_ret == -1) && !dht_inode_missing(op_errno)) { local->op_errno = op_errno; local->op_ret = -1; gf_log (this->name, GF_LOG_DEBUG, @@ -360,7 +360,7 @@ dht_file_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, prev = cookie; local->op_errno = op_errno; - if ((op_ret == -1) && (op_errno != ENOENT)) { + if ((op_ret == -1) && !dht_inode_missing(op_errno)) { gf_log (this->name, GF_LOG_DEBUG, "subvolume %s returned -1 (%s)", prev->this->name, strerror (op_errno)); diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index 3331db5c518..ca6f10d7a92 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -532,6 +532,7 @@ dht_layout_anomalies (xlator_t *this, loc_t *loc, dht_layout_t *layout, switch (layout->list[i].err) { case -1: case ENOENT: + case ESTALE: missing++; break; case ENOTCONN: |