diff options
author | Raghavendra G <raghavendra@gluster.com> | 2010-11-11 23:00:19 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-11-13 07:02:57 -0800 |
commit | d6f1f04ef0db60bcc0f4963dbd1b76ce73c36779 (patch) | |
tree | 5d7da88c20122940c3dff62099af418166046968 /xlators | |
parent | 20fb15dc02a4d1a4b38335a988c0c1abafee7355 (diff) |
performance/quick-read: handle the errors in qr_loc_fill properly when an fop needs to do open before continuing.v3.1.1qa6
- without need_unwind set, 'goto out' will result in infinite loop.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2075 (inode_from_path silently consumes 99% CPU causing nfs client disconnects)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2075
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 26 |
1 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 4ec38a9e05e..24e187a789d 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -82,7 +82,8 @@ qr_loc_fill (loc_t *loc, inode_t *inode, char *path) int32_t ret = -1; char *parent = NULL; - if ((loc == NULL) || (inode == NULL) || (path == NULL)) { + if ((loc == NULL) || (inode == NULL) || (path == NULL) + || (inode->table == NULL)) { ret = -1; errno = EINVAL; goto out; @@ -103,7 +104,6 @@ qr_loc_fill (loc_t *loc, inode_t *inode, char *path) loc->parent = inode_from_path (inode->table, parent); if (loc->parent == NULL) { ret = -1; - errno = EINVAL; goto out; } @@ -1125,6 +1125,8 @@ out: if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { + need_unwind = 1; + op_errno = errno; qr_resume_pending_ops (qr_fd_ctx); goto out; } @@ -1262,6 +1264,8 @@ out: } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { + need_unwind = 1; + op_errno = errno; qr_resume_pending_ops (qr_fd_ctx); goto out; } @@ -1357,6 +1361,8 @@ out: op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { qr_resume_pending_ops (qr_fd_ctx); + need_unwind = 1; + op_errno = errno; goto out; } @@ -1459,6 +1465,8 @@ out: op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { qr_resume_pending_ops (qr_fd_ctx); + need_unwind = 1; + op_errno = errno; goto out; } @@ -1557,6 +1565,8 @@ out: op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { qr_resume_pending_ops (qr_fd_ctx); + op_errno = errno; + need_unwind = 1; goto out; } @@ -1657,6 +1667,8 @@ out: } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { + need_unwind = 1; + op_errno = errno; qr_resume_pending_ops (qr_fd_ctx); goto out; } @@ -1829,6 +1841,8 @@ out: } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { + need_unwind = 1; + op_errno = errno; qr_resume_pending_ops (qr_fd_ctx); goto out; } @@ -1929,6 +1943,8 @@ out: } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { + need_unwind = 1; + op_errno = errno; qr_resume_pending_ops (qr_fd_ctx); goto out; } @@ -2023,6 +2039,8 @@ out: } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { + need_unwind = 1; + op_errno = errno; qr_resume_pending_ops (qr_fd_ctx); goto out; } @@ -2176,6 +2194,8 @@ out: } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { + need_unwind = 1; + op_errno = errno; qr_resume_pending_ops (qr_fd_ctx); goto out; } @@ -2273,6 +2293,8 @@ out: } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { + op_errno = errno; + need_unwind = 1; qr_resume_pending_ops (qr_fd_ctx); goto out; } |