The branch, v4-5-test has been updated via 68302ce ctdb-recovery-helper: Add missing initialisation of ban_credits via 7f0a86b lib: poll_funcs : poll_funcs_context_slot_find can select the wrong slot to replace. via 6411b3d lib/poll_funcs: free contexts in poll_funcs_state_destructor() via a69dae2 smbd: Reset O_NONBLOCK on open files from dbbf8dc ctdb-protocol: Fix marshalling for GET_DB_SEQNUM control request
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-5-test - Log ----------------------------------------------------------------- commit 68302ceb9cac6a1f79fa534a5830da9a0b5c0a3b Author: Amitay Isaacs <ami...@gmail.com> Date: Mon Sep 19 14:59:06 2016 +1000 ctdb-recovery-helper: Add missing initialisation of ban_credits BUG: https://bugzilla.samba.org/show_bug.cgi?id=12275 Signed-off-by: Amitay Isaacs <ami...@gmail.com> Reviewed-by: Martin Schwenke <mar...@meltin.net> (cherry picked from commit 6b93b57921fad40cb3601888154c2f73a75fd590) Autobuild-User(v4-5-test): Karolin Seeger <ksee...@samba.org> Autobuild-Date(v4-5-test): Wed Sep 21 15:53:49 CEST 2016 on sn-devel-144 commit 7f0a86bbbb296da90dcb40dee16b4a68efa7b276 Author: Jeremy Allison <j...@samba.org> Date: Mon Sep 19 11:47:22 2016 -0700 lib: poll_funcs : poll_funcs_context_slot_find can select the wrong slot to replace. Look for an exact match first, before a free slot. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12272 Back-port from 085542fc93b3c603e8cda6e481e94d5fe2dfc669 Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> commit 6411b3dfbad88dc5f3c068c7a02a8332bdf4d29c Author: Jeremy Allison <j...@samba.org> Date: Mon Sep 19 11:42:05 2016 -0700 lib/poll_funcs: free contexts in poll_funcs_state_destructor() This ensures the destructors get called in the proper order. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12272 Back-port from c132b78c484c14d255a98567e90b934b73ebf8c2 Signed-off-by: Ralph Boehme <s...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit a69dae26d7a6dd4b1e3cc958c9fd05980668a5a3 Author: Volker Lendecke <v...@samba.org> Date: Mon Aug 29 09:58:45 2016 +0200 smbd: Reset O_NONBLOCK on open files See the comment inline :-) Bug: https://bugzilla.samba.org/show_bug.cgi?id=12268 Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Simo <s...@samba.org> Autobuild-User(master): Volker Lendecke <v...@samba.org> Autobuild-Date(master): Thu Sep 15 20:21:41 CEST 2016 on sn-devel-144 (cherry picked from commit e69b17d603e5f09ac1e7ee05fc1f5ad67288c484) ----------------------------------------------------------------------- Summary of changes: ctdb/server/ctdb_recovery_helper.c | 1 + lib/poll_funcs/poll_funcs_tevent.c | 17 ++++++++++++++++- source3/smbd/open.c | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c index 9e142cd..4e4a986 100644 --- a/ctdb/server/ctdb_recovery_helper.c +++ b/ctdb/server/ctdb_recovery_helper.c @@ -1400,6 +1400,7 @@ static struct tevent_req *collect_all_db_send( state->pnn_list = pnn_list; state->count = count; state->caps = caps; + state->ban_credits = ban_credits; state->db_id = db_id; state->recdb = recdb; state->index = 0; diff --git a/lib/poll_funcs/poll_funcs_tevent.c b/lib/poll_funcs/poll_funcs_tevent.c index 8fdf080..65adb2d 100644 --- a/lib/poll_funcs/poll_funcs_tevent.c +++ b/lib/poll_funcs/poll_funcs_tevent.c @@ -302,6 +302,9 @@ static int poll_funcs_state_destructor(struct poll_funcs_state *state) for (i=0; i<state->num_watches; i++) { TALLOC_FREE(state->watches[i]); } + for (i=0; i<state->num_contexts; i++) { + TALLOC_FREE(state->contexts[i]); + } return 0; } @@ -315,15 +318,27 @@ static bool poll_funcs_context_slot_find(struct poll_funcs_state *state, struct poll_funcs_tevent_context **contexts; unsigned i; + /* Look for an existing match first. */ for (i=0; i<state->num_contexts; i++) { struct poll_funcs_tevent_context *ctx = state->contexts[i]; - if ((ctx == NULL) || (ctx->ev == ev)) { + if (ctx != NULL && ctx->ev == ev) { *slot = i; return true; } } + /* Now look for a free slot. */ + for (i=0; i<state->num_contexts; i++) { + struct poll_funcs_tevent_context *ctx = state->contexts[i]; + + if (ctx == NULL) { + *slot = i; + return true; + } + } + + contexts = talloc_realloc(state, state->contexts, struct poll_funcs_tevent_context *, state->num_contexts + 1); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 2ae6f83..9d10d19 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -901,6 +901,25 @@ static NTSTATUS open_file(files_struct *fsp, return status; } + if (local_flags & O_NONBLOCK) { + /* + * GPFS can return ETIMEDOUT for pread on + * nonblocking file descriptors when files + * migrated to tape need to be recalled. I + * could imagine this happens elsehwere + * too. With blocking file descriptors this + * does not happen. + */ + ret = set_blocking(fsp->fh->fd, true); + if (ret == -1) { + status = map_nt_error_from_unix(errno); + DBG_WARNING("Could not set fd to blocking: " + "%s\n", strerror(errno)); + fd_close(fsp); + return status; + } + } + ret = SMB_VFS_FSTAT(fsp, &smb_fname->st); if (ret == -1) { /* If we have an fd, this stat should succeed. */ -- Samba Shared Repository