From f46c4dfe28831a6e8d610589c0d45193070c4864 Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Fri, 17 Aug 2012 17:40:24 +0200 Subject: [PATCH] s3:vfs_tsmsm only send notifications when file was offline before Autobuild-User(master): Christian Ambach Autobuild-Date(master): Fri Aug 17 20:05:30 CEST 2012 on sn-devel-104 --- source3/modules/vfs_tsmsm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source3/modules/vfs_tsmsm.c b/source3/modules/vfs_tsmsm.c index db9df25a906..e4bc7eb4541 100644 --- a/source3/modules/vfs_tsmsm.c +++ b/source3/modules/vfs_tsmsm.c @@ -290,6 +290,7 @@ struct tsmsm_pread_state { struct files_struct *fsp; ssize_t ret; int err; + bool was_offline; }; static void tsmsm_pread_done(struct tevent_req *subreq); @@ -308,6 +309,7 @@ static struct tevent_req *tsmsm_pread_send(struct vfs_handle_struct *handle, return NULL; } state->fsp = fsp; + state->was_offline = tsmsm_aio_force(handle, fsp); subreq = SMB_VFS_NEXT_PREAD_SEND(state, ev, handle, fsp, data, n, offset); if (tevent_req_nomem(subreq, req)) { @@ -337,7 +339,7 @@ static ssize_t tsmsm_pread_recv(struct tevent_req *req, int *err) if (tevent_req_is_unix_error(req, err)) { return -1; } - if (state->ret >= 0) { + if (state->ret >= 0 && state->was_offline) { struct files_struct *fsp = state->fsp; notify_fname(fsp->conn, NOTIFY_ACTION_MODIFIED, FILE_NOTIFY_CHANGE_ATTRIBUTES, @@ -351,6 +353,7 @@ struct tsmsm_pwrite_state { struct files_struct *fsp; ssize_t ret; int err; + bool was_offline; }; static void tsmsm_pwrite_done(struct tevent_req *subreq); @@ -370,6 +373,7 @@ static struct tevent_req *tsmsm_pwrite_send(struct vfs_handle_struct *handle, return NULL; } state->fsp = fsp; + state->was_offline = tsmsm_aio_force(handle, fsp); subreq = SMB_VFS_NEXT_PWRITE_SEND(state, ev, handle, fsp, data, n, offset); if (tevent_req_nomem(subreq, req)) { @@ -399,7 +403,7 @@ static ssize_t tsmsm_pwrite_recv(struct tevent_req *req, int *err) if (tevent_req_is_unix_error(req, err)) { return -1; } - if (state->ret >= 0) { + if (state->ret >= 0 && state->was_offline) { struct files_struct *fsp = state->fsp; notify_fname(fsp->conn, NOTIFY_ACTION_MODIFIED, FILE_NOTIFY_CHANGE_ATTRIBUTES, -- 2.11.4.GIT