summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-08-31 22:53:33 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-08 03:22:39 -0700
commit6cd8070af4c83cca9f3f7685a2a04bcb95059dd1 (patch)
tree6a5b5acf1e89bac1f2b615b1ac9eca8db020416b
parentd6bc71ccb3a5265b01d188497213d797d7217c3d (diff)
performance/quick-read: if open fails during cache validation, don't continue validation process.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 232 (Quick-read: if open fails during cache validation, don't continue validation process.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=232
-rw-r--r--xlators/performance/quick-read/src/quick-read.c24
-rw-r--r--xlators/performance/quick-read/src/quick-read.h2
2 files changed, 24 insertions, 2 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index c63c920a0..9e09422bb 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -300,6 +300,8 @@ qr_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
op_ret = -1;
op_errno = EINVAL;
} else {
+ local->op_ret = op_ret;
+ local->op_errno = op_errno;
is_open = local->is_open;
}
@@ -557,8 +559,26 @@ unwind:
int32_t
qr_validate_cache_helper (call_frame_t *frame, xlator_t *this, fd_t *fd)
{
- STACK_WIND (frame, qr_validate_cache_cbk, FIRST_CHILD (this),
- FIRST_CHILD (this)->fops->fstat, fd);
+ qr_local_t *local = NULL;
+ int32_t op_ret = -1, op_errno = -1;
+
+ local = frame->local;
+ if (local == NULL) {
+ op_ret = -1;
+ op_errno = EINVAL;
+ } else {
+ op_ret = local->op_ret;
+ op_errno = local->op_errno;
+ }
+
+ if (op_ret == -1) {
+ qr_validate_cache_cbk (frame, NULL, this, op_ret, op_errno,
+ NULL);
+ } else {
+ STACK_WIND (frame, qr_validate_cache_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->fstat, fd);
+ }
+
return 0;
}
diff --git a/xlators/performance/quick-read/src/quick-read.h b/xlators/performance/quick-read/src/quick-read.h
index 32bebac48..c49ab167b 100644
--- a/xlators/performance/quick-read/src/quick-read.h
+++ b/xlators/performance/quick-read/src/quick-read.h
@@ -57,6 +57,8 @@ struct qr_local {
char is_open;
fd_t *fd;
int open_flags;
+ int32_t op_ret;
+ int32_t op_errno;
call_stub_t *stub;
};
typedef struct qr_local qr_local_t;