Jeremy Allison [Mon, 12 Aug 2019 23:49:26 +0000 (16:49 -0700)]
s3: VFS: Add SMB_VFS_LINKAT().
Currently identical to SMB_VFS_LINK().
Next, move add to all VFS modules that implement
link and eventually remove link.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Anoop C S [Mon, 5 Aug 2019 05:15:01 +0000 (10:45 +0530)]
vfs_glusterfs: Enable profiling for file system operations
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14093
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 20 19:25:28 UTC 2019 on sn-devel-184
Stefan Metzmacher [Tue, 20 Aug 2019 12:55:27 +0000 (14:55 +0200)]
tdb: Release tdb 1.4.2
* Build fixes
* Improve the performance by inlining the tdb_oob() checks
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 20 14:45:41 UTC 2019 on sn-devel-184
Martin Schwenke [Mon, 19 Aug 2019 11:48:04 +0000 (21:48 +1000)]
ctdb-daemon: Make node inactive in the NODE_STOP control
Currently some of this is supported by a periodic check in the
recovery daemon's main_loop(), which notices the flag change, sets
recovery mode active and freezes databases. If STOP_NODE returns
immediately then the associated recovery can complete and the node can
be continued before databases are actually frozen.
Instead, immediately do all of the things that make a node inactive.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087
RN: Stop "ctdb stop" from completing before freezing databases
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Aug 20 08:32:27 UTC 2019 on sn-devel-184
Martin Schwenke [Tue, 20 Aug 2019 01:29:42 +0000 (11:29 +1000)]
ctdb-daemon: Drop unused function ctdb_local_node_got_banned()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 19 Aug 2019 11:52:57 +0000 (21:52 +1000)]
ctdb-daemon: Switch banning code to use ctdb_node_become_inactive()
There's no reason to avoid immediately setting recovery mode to active
and initiating freeze of databases.
This effectively reverts the following commits:
d8f3b490bbb691c9916eed0df5b980c1aef23c85
b4357a79d916b1f8ade8fa78563fbef0ce670aa9
The latter is now implemented using a control, resulting in looser
coupling.
See also the following commit:
f8141e91a693912ea1107a49320e83702a80757a
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Mon, 19 Aug 2019 11:47:03 +0000 (21:47 +1000)]
ctdb-daemon: Factor out new function ctdb_node_become_inactive()
This is a superset of ctdb_local_node_got_banned() so will replace
that function, and will also be used in the NODE_STOP control.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14087
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
David Disseldorp [Sun, 18 Aug 2019 09:24:37 +0000 (11:24 +0200)]
build: fix mandatory typo in zlib configure check
This ensures that waf correctly fails during configure if zlib is
missing.
msg can also be dropped as it matches the waf validate_cfg() default
(ignoring the quotes).
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 20 06:58:12 UTC 2019 on sn-devel-184
Tim Beale [Tue, 30 Jul 2019 22:54:29 +0000 (10:54 +1200)]
ldb: Free memory when repacking database
The msg for each database record is allocated on the module context, but
never freed. The module seems like it could be a long-running context (as
the database would normally get repacked by the samba executable).
Even if it's not a proper leak, it shouldn't hurt to cleanup the memory.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Tue Aug 20 04:57:10 UTC 2019 on sn-devel-184
Tim Beale [Tue, 30 Jul 2019 22:33:49 +0000 (10:33 +1200)]
ldb: Log the partition we're repacking
Firstly, with Samba AD this looks a little weird because we log the same
message 5 times (once for every partition). If we log that we're doing
this to records in different partitions, hopefully someone with a little
Samba knowledge can figure out what's going on.
Secondly, the info about what partitions are actually changing might be
useful. E.g. if we hit a fatal error repacking the 3rd partition, and
the transaction doesn't abort properly, then it would be useful to know
what partitions were repacked and which ones weren't.
There doesn't appear to be a useful name for the partition
(ldb_kv->kv_ops->name() doesn't seem any more intelligible to a user),
so just log the first record that we update. We can use that to infer
the partition database).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Tim Beale [Tue, 30 Jul 2019 04:40:55 +0000 (16:40 +1200)]
ldb: Log pack format in user-friendly way
The "format 0x26011968" log confused me (and I'm a developer).
We can subtract the base offset from the pack format to get a more
user-friendly number, e.g. v0 (not actually used), v1, v2, etc.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Tim Beale [Tue, 30 Jul 2019 03:15:40 +0000 (15:15 +1200)]
ldb: Change pack format defines to enum
The main reason is so that any future pack formats will continue
incrementing this number in a sequential fashion.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Tim Beale [Tue, 30 Jul 2019 03:02:25 +0000 (15:02 +1200)]
ldb: Move where we update the pack format version
Store it on the repack context so that we can log a more informative
message "Repacking from format x to format y".
While this is not really a big deal currently, it could be worth
recording for potential future scenarios (i.e. supporting three or more
pack versions), where upgrades could potentially skip an intermediary
pack format version.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Tim Beale [Tue, 30 Jul 2019 04:40:55 +0000 (16:40 +1200)]
ldb: Always log when the database pack format changes
LDB_DEBUG_WARNING gets logged by Samba as level 2, whereas the default
log level for Samba is 0. It's not really fair to the user to change the
format of their database on disk and potentially not tell them.
This patch adds a log with level zero (using a alias define, as this
technically isn't a fatal problem).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Aaron Haslett [Mon, 22 Jul 2019 01:35:21 +0000 (13:35 +1200)]
downgradedatabase: installing script
Installing downgrade script so people don't need the source tree for it.
Exception added in usage test because running the script without arguments
is valid. (This avoids the need to knownfail it).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Aaron Haslett [Mon, 22 Jul 2019 01:35:21 +0000 (13:35 +1200)]
downgradedatabase: Add man-page documentation
A man-page is needed so that we can install this tool as part of the
Samba package.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Tim Beale [Mon, 29 Jul 2019 01:39:04 +0000 (13:39 +1200)]
downgradedatabase: rename to samba_downgrade_db
Just so that it's slightly less of a mouthful for users.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Tim Beale [Mon, 29 Jul 2019 01:35:08 +0000 (13:35 +1200)]
tests: Avoid hardcoding relative filepath
If we move the test file, the test will break.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Aaron Haslett [Mon, 22 Jul 2019 03:29:03 +0000 (15:29 +1200)]
downgradedatabase: comply with samba.tests.source
In next commit we'll install the script, samba.tests.source picked up the
lack of a copyright message and some whitespace errors, so this patch
fixes that stuff first.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059
Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Volker Lendecke [Tue, 13 Aug 2019 14:56:58 +0000 (16:56 +0200)]
smbd: Move lease type detection in delay_for_oplock()
Walk the share_modes array only once.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Aug 20 00:33:12 UTC 2019 on sn-devel-184
Volker Lendecke [Sat, 10 Aug 2019 19:23:24 +0000 (21:23 +0200)]
smbd: Merge grant_fsp_oplock_type() into delay_for_oplock()
This is a preparation for the next commit: Only walk the share_modes[]
array once when handling oplocks and leases.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Sat, 10 Aug 2019 19:17:05 +0000 (21:17 +0200)]
smbd: Move delay_for_oplock() down
We'll merge grant_fsp_oplock_type() into this function. This makes the next
commit smaller, and the newly extended delay_for_oplocks will for example
reference static file_has_brlocks() above. Make forward declarations
unnecessary.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Sat, 10 Aug 2019 19:15:22 +0000 (21:15 +0200)]
smbd: Make delay_for_oplock() return NTSTATUS
A further commit will merge grant_fsp_oplock_type (returning NTSTATUS)
into delay_for_oplock(). Make that commit smaller.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 9 Aug 2019 11:39:34 +0000 (13:39 +0200)]
smbd: Slightly simplify grant_fsp_oplock_type()
This is never called with INTERNAL_OPENs anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 9 Aug 2019 11:38:40 +0000 (13:38 +0200)]
smbd: Slightly simplify delay_for_oplock()
This is never called for INTERNAL_OPENs anymore, see
handle_share_mode_lease()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 7 Aug 2019 10:15:45 +0000 (12:15 +0200)]
smbd: Introduce handle_share_mode_lease()
This consolidates the core share_mode_lock access of open_file_ntcreate
into one routine.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Tue, 6 Aug 2019 14:28:29 +0000 (16:28 +0200)]
smbd: Move set_share_mode() out of grant_fsp_oplock_type()
This shows that "req", "share_access" and "access_mask" are not needed
for the core logic of grant_fsp_oplock_type() and it separates
concerns a bit: open_directory() also does the set_share_mode() in the
main open routine, not in a helper like grant_fsp_oplock_type()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 14:31:17 +0000 (16:31 +0200)]
smbd: Move grant_fsp_oplock_type() close to delay_for_oplock()
Note that this is not a cut&paste: Instead of fsp->access_mask we use
the access_mask the client requested. At the new code location
fsp->access_mask (a.k.a. open_access_mask) might have FILE_WRITE_DATA
from O_TRUNC (a.k.a. FILE_OVERWRITE).
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 2 Aug 2019 13:24:16 +0000 (15:24 +0200)]
smbd: Slightly simplify open_file_ntcreate()
There is no reference to "file_existed" after this point anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Fri, 2 Aug 2019 13:21:49 +0000 (15:21 +0200)]
smbd: Remove a late ref to "file_existed" in open_file_ntcreate()
If you follow "existing_dos_attributes" through the routine, this can
only ever be !=0 if SMB_VFS_GET_DOS_ATTRIBUTES() was successful. This
can only have been successful if the file existed.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 25 Jul 2019 09:52:21 +0000 (11:52 +0200)]
smbd: Move resetting "oplock_request" to before delay_for_oplock()
It seems to make little sense to me to do the oplock break with one
setting and then later on grant_fsp_oplock_type with another
one. Survives tests, I can't think of any scenario where this (to me)
simplification would break anything
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Sun, 18 Aug 2019 06:57:38 +0000 (08:57 +0200)]
smbd: For kernel-oplocked files don't call delay_for_oplock()
The kernel has already sent the signal. We don't have to send another
message. Instead, just directly wait for the downgrade to happen via
the watch on the share mode lock assuming it's there. Also setup the
polling interval: I could imagine that in some race situation the file
has already been closed and re-opened by a nonsamba process while we
were waiting.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Sun, 18 Aug 2019 06:55:14 +0000 (08:55 +0200)]
smbd: Optionally wait for a share mode record in setup_poll_open()
This will be used when waiting for a oplock break that has been
signalled via a kernel oplock break.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Wed, 14 Aug 2019 19:27:53 +0000 (21:27 +0200)]
smbd: Simplify has_other_nonposix_opens()
We pick quite some information from "fsp" already, so from an API design
perspecitve it's only fair to only use its implicit server_id. This is
what all the callers did anyway.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Wed, 14 Aug 2019 19:39:50 +0000 (21:39 +0200)]
smbd: Align integer types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Sat, 10 Aug 2019 13:01:24 +0000 (15:01 +0200)]
smbd: Simplify delay_for_oplock()
Use is_same_lease()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Sat, 10 Aug 2019 13:01:00 +0000 (15:01 +0200)]
smbd: Move is_same_lease() up in the file
The next commit will need it there
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Sat, 10 Aug 2019 12:28:51 +0000 (14:28 +0200)]
smbd: Simplify is_same_lease()
It does not use "struct share_mode_data"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Sat, 10 Aug 2019 12:44:08 +0000 (14:44 +0200)]
smbd: Optimize delay_for_oplock()
get_lease_type() can involve a database access. Do that only if
necessary, and that is at most once in this loop.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Sat, 10 Aug 2019 14:45:30 +0000 (16:45 +0200)]
lib: Remove a duplicate function prototype
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Fri, 9 Aug 2019 11:48:53 +0000 (13:48 +0200)]
smbd: Remove a misleading comment
open_mode_check() is done before the oplock breaks.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Mon, 12 Aug 2019 10:12:48 +0000 (12:12 +0200)]
smbd: Merge two DEBUGs into one
This looks easier to understand to me, less lines in logfiles
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Mon, 12 Aug 2019 09:44:39 +0000 (11:44 +0200)]
smbd: Avoid casts in share_conflict()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Sat, 10 Aug 2019 20:15:05 +0000 (22:15 +0200)]
smbd: Save two lines in find_share_mode_entry
Directly initialized variables give compilers less reason to complain
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Volker Lendecke [Tue, 13 Aug 2019 12:43:08 +0000 (14:43 +0200)]
lib: Micro-optimization for db_tdb_do_locked()
We don't need the tdb lock for the talloc_free(buf) anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Andrew Bartlett [Fri, 16 Aug 2019 08:58:32 +0000 (20:58 +1200)]
third_party: Remove historical tombstone about zlib divergance
Now this has been recorded in the git history, we can remove it.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Aug 17 05:10:48 UTC 2019 on sn-devel-184
Andrew Bartlett [Fri, 16 Aug 2019 05:43:51 +0000 (17:43 +1200)]
third_party: Remove zlib from third_party
We require zlib 1.2.3.
We stopped requring a patched zlib with
5631a1b9bc03d6cf31af66b13872255f18979fe8
As discussed on samba-technical here:
https://lists.samba.org/archive/samba-technical/2019-May/133476.html
In short, zlib contains some (old, now broken) crypto code that while not compiled
in Samba is best left out of our tarball to ease crypto audits. It is also very
very out of date and is a slightly modified copy of something otherwise very
likely available on our supported host OSs. It would be strange to say that
GnuTLS and dependencies are an acceptable burden to install but say zlib is
a step to far.
So it is removed from Samba's third_party with this commit.
The diff between zlib in Samba and official zlib 1.2.3 is included
in third_party/zlib/last-samba-from-1.2.3.diff
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
David Mulder [Tue, 6 Aug 2019 17:31:08 +0000 (11:31 -0600)]
Prevent samba-tool online backup crash
On some GPOs, getting a files ntacl throws an
NT_STATUS_ACCESS_DENIED. Catch and log the
failure when this happens.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14088
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Martin Schwenke [Tue, 13 Aug 2019 07:08:43 +0000 (17:08 +1000)]
ctdb-tcp: Mark node as disconnected if incoming connection goes away
To make it easy to pass the node data to the upcall, the private data
for ctdb_tcp_read_cb() needs to be changed from tnode to node.
RN: Avoid marking a node as connected before it can receive packets
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Aug 16 22:50:35 UTC 2019 on sn-devel-184
Martin Schwenke [Fri, 9 Aug 2019 05:33:05 +0000 (15:33 +1000)]
ctdb-tcp: Only mark a node connected if both directions are up
Nodes are currently marked as up if the outgoing connection is
established. However, if the incoming connection is not yet
established then this node could send a request where the replying
node can not queue its reply. Wait until both directions are up
before marking a node as connected.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Thu, 15 Aug 2019 05:57:31 +0000 (15:57 +1000)]
ctdb-tcp: Create outbound queue when the connection becomes writable
Since commit
ddd97553f0a8bfaada178ec4a7460d76fa21f079
ctdb_queue_send() doesn't queue a packet if the connection isn't yet
established (i.e. when fd == -1). So, don't bother creating the
outbound queue during initialisation but create it when the connection
becomes writable.
Now the presence of the queue indicates that the outbound connection
is up.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Thu, 15 Aug 2019 05:45:16 +0000 (15:45 +1000)]
ctdb-tcp: Use TALLOC_FREE()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Fri, 9 Aug 2019 05:29:36 +0000 (15:29 +1000)]
ctdb-tcp: Move incoming fd and queue into struct ctdb_tcp_node
This makes it easy to track both incoming and outgoing connectivity
states.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Fri, 9 Aug 2019 05:06:34 +0000 (15:06 +1000)]
ctdb-tcp: Rename fd -> out_fd
in_fd is coming soon.
Fix coding style violations in the affected and adjacent lines.
Modernise some debug macros and make them more consistent (e.g. drop
logging of errno when strerror(errno) is already logged.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Martin Schwenke [Thu, 8 Aug 2019 06:20:44 +0000 (16:20 +1000)]
ctdb-daemon: Add function ctdb_ip_to_node()
This is the core logic from ctdb_ip_to_pnn(), so re-implement that
that function using ctdb_ip_to_node().
Something similar (ctdb_ip_to_nodeid()) was recently removed in commit
010c1d77cd7e192b1fff39b7b91fccbdbbf4a786 because it wasn't required.
Now there is a use case.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Jeremy Allison [Mon, 12 Aug 2019 17:34:37 +0000 (10:34 -0700)]
s3: VFS: vfs_default. Convert underlying system call to renameat().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 16 21:10:14 UTC 2019 on sn-devel-184
Jeremy Allison [Fri, 9 Aug 2019 23:28:32 +0000 (16:28 -0700)]
s3: VFS: Complete the replacement of SMB_VFS_RENAME() -> SMB_VFS_RENAMEAT().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:14:14 +0000 (16:14 -0700)]
s3: VFS: vfs_time_audit. Remove rename_fn(). No longer used.
NB, this will now fail smb_vfs_assert_all_fns()
until we remove the rename_fn() from the VFS definitions.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:04:35 +0000 (16:04 -0700)]
s3: VFS: vfs_full_audit. Remove rename_fn(). No longer used.
NB, this will now fail smb_vfs_assert_all_fns()
until we remove the rename_fn() from the VFS definitions.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:38:11 +0000 (16:38 -0700)]
s3: VFS: vfs_virusfilter. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:13:16 +0000 (16:13 -0700)]
s3: VFS: vfs_unityed_media. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:12:25 +0000 (16:12 -0700)]
s3: VFS: vfs_syncops. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:11:43 +0000 (16:11 -0700)]
s3: VFS: vfs_streams_xattr. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:29:58 +0000 (16:29 -0700)]
s3: VFS: vfs_streams_depot: Change to using SMB_VFS_RENAMEAT() instead of SMB_VFS_RENAME().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:10:57 +0000 (16:10 -0700)]
s3: VFS: vfs_streams_depot. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:10:06 +0000 (16:10 -0700)]
s3: VFS: vfs_snapper. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:08:53 +0000 (16:08 -0700)]
s3: VFS: vfs_shadow_copy2. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:07:53 +0000 (16:07 -0700)]
s3: VFS: vfs_netatalk. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:07:14 +0000 (16:07 -0700)]
s3: VFS: vfs_media_harmony. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:06:11 +0000 (16:06 -0700)]
s3: VFS: vfs_glusterfs. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:03:11 +0000 (16:03 -0700)]
s3: VFS: vfs_fruit. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:01:57 +0000 (16:01 -0700)]
s3: VFS: vfs_extd_audit. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:59:54 +0000 (15:59 -0700)]
s3: VFS: vfs_crossrename. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:59:05 +0000 (15:59 -0700)]
s3: VFS: vfs_ceph_snapshots. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:58:11 +0000 (15:58 -0700)]
s3: VFS: vfs_ceph. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:56:59 +0000 (15:56 -0700)]
s3: VFS: vfs_catia. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:55:48 +0000 (15:55 -0700)]
s3: VFS: vfs_cap. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:41:59 +0000 (15:41 -0700)]
s3: VFS: vfs_audit. Remove rename_fn(). No longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:27:49 +0000 (16:27 -0700)]
s3: VFS: vfs_recycle. Use SMB_VFS_RENAMEAT() instead of SMB_VFS_RENAME().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:26:10 +0000 (16:26 -0700)]
s3: smbd: vfs_virusfilter: Use SMB_VFS_RENAMEAT() instead of SMB_VFS_RENAME.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:40:47 +0000 (15:40 -0700)]
s3: torture: Change cmd_vfs to call SMB_VFS_RENAMEAT().
Use conn->cwd_fsp as current src and dst fsp's.
No logic change for now.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:38:32 +0000 (15:38 -0700)]
s3: smbd: Change rename_internals_fsp() to call SMB_VFS_RENAMEAT().
Use conn->cwd_fsp as current src and dst fsp's.
No logic change for now.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 23:36:32 +0000 (16:36 -0700)]
s3: VFS: vfs_virusfilter. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:36:52 +0000 (15:36 -0700)]
s3: VFS: vfs_unityed_media. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:34:52 +0000 (15:34 -0700)]
s3: VFS: vfs_time_audit. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:33:08 +0000 (15:33 -0700)]
s3: VFS: vfs_syncops. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:31:03 +0000 (15:31 -0700)]
s3: VFS: vfs_streams_xattr. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:28:56 +0000 (15:28 -0700)]
s3: VFS: vfs_streams_depot. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:28:34 +0000 (15:28 -0700)]
s3: VFS: vfs_snapper. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:13:24 +0000 (15:13 -0700)]
s3: VFS: vfs_shadow_copy2. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:03:44 +0000 (15:03 -0700)]
s3: VFS: vfs_netatalk. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:03:06 +0000 (15:03 -0700)]
s3: VFS: vfs_media_harmony. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 22:02:35 +0000 (15:02 -0700)]
s3: VFS: vfs_glusterfs. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 21:25:21 +0000 (14:25 -0700)]
s3: VFS: vfs_full_audit. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 21:22:03 +0000 (14:22 -0700)]
s3: VFS: vfs_fruit. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 21:19:09 +0000 (14:19 -0700)]
s3: VFS: vfs_extd_audit. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 21:16:12 +0000 (14:16 -0700)]
s3: VFS: vfs_crossrename. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 20:49:46 +0000 (13:49 -0700)]
s3: VFS: vfs_ceph_snapshots. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Fri, 9 Aug 2019 20:45:32 +0000 (13:45 -0700)]
s3: VFS: vfs_ceph. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 8 Aug 2019 23:35:54 +0000 (16:35 -0700)]
s3: VFS: vfs_catia. Implement renameat().
Currently identical to rename().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>