summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2012-08-17 17:40:24 +0200
committerChristian Ambach <ambi@samba.org>2012-08-17 20:05:30 +0200
commitf46c4dfe28831a6e8d610589c0d45193070c4864 (patch)
tree5fb423e233c5d55ea145dcc7ea5e007a4d83095a
parentdda4c5d7945e5538588b9a59a456a4e5eb63daf6 (diff)
downloadsamba-f46c4dfe28831a6e8d610589c0d45193070c4864.tar.gz
samba-f46c4dfe28831a6e8d610589c0d45193070c4864.tar.bz2
samba-f46c4dfe28831a6e8d610589c0d45193070c4864.zip
s3:vfs_tsmsm only send notifications when file was offline before
Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Fri Aug 17 20:05:30 CEST 2012 on sn-devel-104
-rw-r--r--source3/modules/vfs_tsmsm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/modules/vfs_tsmsm.c b/source3/modules/vfs_tsmsm.c
index db9df25a90..e4bc7eb454 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,