From ef7524ec1eda990cb89bee06eff2ef2d7c49d0d2 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Wed, 28 Oct 2009 05:40:12 +0000 Subject: fuse: use postbuf in truncate_cbk for attributes to return this causes a problem where inodes even after truncate show old file size for a short time (till attributes are expired in fuse kernel module) Signed-off-by: Anand V. Avati BUG: 146 (Add setattr FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=146 --- xlators/mount/fuse/src/fuse-bridge.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/mount') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 18e51a7faff..b8a91fa0ad0 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -673,7 +673,7 @@ fuse_forget (xlator_t *this, fuse_in_header_t *finh, void *msg) static int fuse_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *buf, + int32_t op_ret, int32_t op_errno, struct stat *prebuf, struct stat *postbuf) { fuse_state_t *state; @@ -690,12 +690,12 @@ fuse_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, "%"PRIu64": %s() %s => %"PRId64, frame->root->unique, gf_fop_list[frame->root->op], state->loc.path ? state->loc.path : "ERR", - buf->st_ino); + prebuf->st_ino); /* TODO: make these timeouts configurable via meta */ /* TODO: what if the inode number has changed by now */ - buf->st_blksize = this->ctx->page_size; - stat2attr (buf, &fao.attr); + postbuf->st_blksize = this->ctx->page_size; + stat2attr (postbuf, &fao.attr); fao.attr_valid = calc_timeout_sec (priv->attribute_timeout); fao.attr_valid_nsec = -- cgit