From 5c9a8a92edbd011e4fd5ec8e5f77eb13d7d8b771 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Fri, 13 Nov 2009 07:53:06 +0000 Subject: protocol/client: preserve open/create flags in fdctx for reopening Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati BUG: 170 (Auto-heal fails on files that are open()-ed/mmap()-ed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=170 --- xlators/protocol/client/src/client-protocol.c | 6 ++++++ xlators/protocol/client/src/client-protocol.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'xlators/protocol/client') diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c index 526260076a0..8af3922b6b8 100644 --- a/xlators/protocol/client/src/client-protocol.c +++ b/xlators/protocol/client/src/client-protocol.c @@ -660,6 +660,7 @@ client_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, local->fd = fd_ref (fd); loc_copy (&local->loc, loc); + local->flags = flags; frame->local = local; @@ -729,6 +730,8 @@ client_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, local->fd = fd_ref (fd); loc_copy (&local->loc, loc); + local->flags = flags; + local->wbflags = wbflags; frame->local = local; @@ -3951,6 +3954,7 @@ client_create_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen, fdctx->inode = inode_ref (fd->inode); fdctx->ino = ino; fdctx->gen = gen; + fdctx->flags = local->flags; INIT_LIST_HEAD (&fdctx->sfd_pos); @@ -4029,6 +4033,8 @@ client_open_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen, fdctx->inode = inode_ref (fd->inode); fdctx->ino = ino; fdctx->gen = gen; + fdctx->flags = local->flags; + fdctx->wbflags = local->wbflags; INIT_LIST_HEAD (&fdctx->sfd_pos); diff --git a/xlators/protocol/client/src/client-protocol.h b/xlators/protocol/client/src/client-protocol.h index 8801d530bb9..27348690296 100644 --- a/xlators/protocol/client/src/client-protocol.h +++ b/xlators/protocol/client/src/client-protocol.h @@ -111,6 +111,8 @@ typedef struct { fd_t *fd; gf_op_t op; client_fd_ctx_t *fdctx; + uint32_t flags; + uint32_t wbflags; } client_local_t; -- cgit