diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-09-17 00:08:26 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-22 06:12:30 -0700 |
commit | f0f547f79792af9fe8228f2028bd1dd30d976e68 (patch) | |
tree | 8b250ca4b0cd802f082176216db9a4cc315d9c47 | |
parent | bad3de155a3a910c6665a39555aeb823803635c9 (diff) |
performance/write-behind: check for the presence of context only in fds not opened on directories.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 260 (ls on booster VMP results in error: "File descriptor in bad state")
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=260
-rw-r--r-- | xlators/performance/write-behind/src/write-behind.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 1f9818051f7..d095917682c 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -701,7 +701,8 @@ wb_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd) wb_request_t *request = NULL; int32_t ret = -1; - if (fd_ctx_get (fd, this, &tmp_file)) { + if ((!S_ISDIR (fd->inode->st_mode)) + && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", fd); @@ -951,7 +952,8 @@ wb_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset) wb_request_t *request = NULL; int32_t ret = -1; - if (fd_ctx_get (fd, this, &tmp_file)) { + if ((!S_ISDIR (fd->inode->st_mode)) + && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", fd); @@ -1712,7 +1714,8 @@ wb_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, if (vector != NULL) size = iov_length (vector, count); - if (fd_ctx_get (fd, this, &tmp_file)) { + if ((!S_ISDIR (fd->inode->st_mode)) + && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", fd); @@ -1863,7 +1866,8 @@ wb_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int32_t ret = -1; wb_request_t *request = NULL; - if (fd_ctx_get (fd, this, &tmp_file)) { + if ((!S_ISDIR (fd->inode->st_mode)) + && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", fd); @@ -2005,7 +2009,8 @@ wb_flush (call_frame_t *frame, xlator_t *this, fd_t *fd) conf = this->private; - if (fd_ctx_get (fd, this, &tmp_file)) { + if ((!S_ISDIR (fd->inode->st_mode)) + && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", fd); @@ -2166,7 +2171,8 @@ wb_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync) wb_request_t *request = NULL; int32_t ret = -1; - if (fd_ctx_get (fd, this, &tmp_file)) { + if ((!S_ISDIR (fd->inode->st_mode)) + && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", fd); |