diff options
author | Raghavendra G <raghavendra@gluster.com> | 2009-09-16 23:58:36 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-22 06:13:39 -0700 |
commit | c179755dd1068e480e3d371dd9fafa94faee90aa (patch) | |
tree | 62de411765db5f871c0e97b21ca9042f7d252e50 /xlators | |
parent | 00b242e1e35b2af7ccbade982e0dae7611cc019e (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
Diffstat (limited to 'xlators')
-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 8f566a137bb..374c173449b 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -585,7 +585,8 @@ wb_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd) uint64_t tmp_file = 0; call_stub_t *stub = 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); @@ -776,7 +777,8 @@ wb_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset) uint64_t tmp_file = 0; call_stub_t *stub = 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); @@ -1463,7 +1465,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); @@ -1580,7 +1583,8 @@ wb_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, uint64_t tmp_file = 0; call_stub_t *stub = 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); @@ -1699,7 +1703,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); @@ -1819,7 +1824,8 @@ wb_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync) uint64_t tmp_file = 0; call_stub_t *stub = 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); |