1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

554 Commits

Author SHA1 Message Date
Volker Lendecke
a7e803485d smbd: We don't use DEFERRED_OPEN_ENTRY anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26 15:17:22 -07:00
Volker Lendecke
afe9446985 smbd: Use dbwrap_record_watch_send for defer_open
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26 15:17:21 -07:00
Christian Ambach
d51b498017 s3:locking add NDR debug in share_mode_forall
Reviewed-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Apr 19 15:06:33 CEST 2013 on sn-devel-104
2013-04-19 15:06:33 +02:00
Gregor Beck
f608bedfca s3:locking: add function share_mode_cleanup_disconnected()
For a given file, clean share mode entries for a given persistent file id.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:13 +02:00
Gregor Beck
0ac0b35dad s3:locking: improve debug output of parse_share_modes()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:13 +02:00
Gregor Beck
3d3e7e837a s3:locking: no need to make a file_id passed by value a constant
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:13 +02:00
Gregor Beck
ee81a6e7d0 s3:locking:brlock: add function brl_cleanup_disconnected()
For a given file, clean up brl entries belonging to a given persistent file id.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:12 +02:00
Michael Adam
6ee1555df2 s3:locking:brlock: explain the lockdb_clean semantic better in brl_reconnect_disconnected()
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:12 +02:00
Gregor Beck
f08bda22dc s3:locking:brlock: let validate_lock_entries keep entries for disconnected servers in traverses
We should not remove locks of disconnected opens just like that.
When getting the byte range lock record for a newly connected file
handle, we still do the clean up, because in that situation,
disconnected entries are not valid any more.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:12 +02:00
Michael Adam
fe0bf0b6d6 s3:locking:brlock: improve the comment for the brl self cleaning code
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:12 +02:00
Gregor Beck
02cc5a5c6a s3:locking:brlock: use serverids_exist to validate_lock_entries
...instead of checking each server-id separately which can
be expensive in a cluster.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18 13:15:12 +02:00
Karolin Seeger
6eb59eb388 brlock.c: Fix typo in comment.
redundent -> redundant

Signed-off-by: Karolin Seeger <kseeger@samba.org>
2013-02-18 22:07:39 +11:00
Volker Lendecke
29f90ecf53 s3: Use dbwrap_parse_record in fetch_share_mode_unlocked
Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-28 18:27:41 +01:00
Stefan Metzmacher
f0a5b791ae s3:locking: add brl_mark_disconnected() and brl_reconnect_disconnected()
Pair-Programmed-With: Michael Adam <obnox@samba.org>
2012-09-08 03:39:06 +02:00
Stefan Metzmacher
9a81f8ee17 s3:locking: add mark_share_mode_disconnected()
Pair-Programmed-With: Michael Adam <obnox@samba.org>
2012-09-08 03:39:06 +02:00
Michael Adam
a3eee547ac s3:locking: fix trailing space in brl_close_fnum()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-05 10:46:37 +02:00
Volker Lendecke
d0df12f3ea s3: Fix a typo
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04 15:15:00 -07:00
Christian Ambach
7c56d80bee s3:brlock: give traverse_fn a proper name 2012-08-16 18:05:29 +02:00
Jeremy Allison
90881da685 Move copy_unix_token() from locking/locking.c to lib/util.c.
Make public.
2012-07-03 15:34:22 -07:00
Stefan Metzmacher
bbad8f6d72 s3:brlock: s/int/uint64_t for fnum
fsp->fnum and lock->fnum are uint64_t already and we should not truncate the value here.

Currently this doesn't matter as we only use 16-bit.

But as 'int' is int32_t and we later compare fnum with lock->fnum == fnum,
the cast from int32_t to uint64_t goes via int64_t instead of uint32_t.

This means even if fsp->fnum just uses 32-bit of the uint64_t
we'll get the wrong result, as the implicit cast from a negative int32_t
value to uint64_t adds 0xFFFFFFFF00000000.

metze
2012-06-28 10:08:03 +02:00
Stefan Metzmacher
c5f1ab9a88 s3:brlock: add some const to print_lock_struct()
metze
2012-06-28 10:08:02 +02:00
Volker Lendecke
770d9affd7 s3: Remove reduce_windows_lock_ref_count, used only once
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22 15:16:51 +02:00
Volker Lendecke
89b2eb1d06 s3: Make reduce_windows_lock_ref_count static
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22 15:16:49 +02:00
Volker Lendecke
6658a2f6ef s3: Use dbwrap_util for windows_lock_ref_count
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-22 15:16:48 +02:00
Michael Adam
73b200064f s3:util: rename procid_equal() to serverid_equal()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:32 +02:00
Volker Lendecke
ca9a734e19 s3: Remove a user of procid_is_me
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:30 +02:00
Michael Adam
959c10e612 s3:locking: change locking.c to use fsp_fnum_dbg() for fsp->fnum logging.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15 03:28:14 +02:00
Michael Adam
7472380e13 s3:locking: change brlock.c to use fsp_fnum_dbg() for fsp->fnum logging.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15 03:28:14 +02:00
Volker Lendecke
7e63e2230c s3: Fix a comment
The fd count is implicit

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 14 01:53:17 CEST 2012 on sn-devel-104
2012-06-14 01:53:17 +02:00
Michael Adam
1c01cb4510 s3:include: change lock_struct->fnum to uint64_t
Note: this changes the format of brlock.tdb!

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Jun  6 23:22:00 CEST 2012 on sn-devel-104
2012-06-06 23:21:59 +02:00
Michael Adam
4389097294 s3:include: change connection_struct->cnum to uint32_t
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-06-06 19:37:14 +02:00
Volker Lendecke
dec08b8041 s3: Simplify get_delete_on_close_token more
All remaining callers actually want the token

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-03 17:23:28 +02:00
Volker Lendecke
103b89fb07 s3: Simplify get_delete_on_close_token slightly
Introduce find_delete_on_close_token. Thus is_delete_on_close_set
does not have to call get_delete_on_close_token anymore.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-03 17:23:28 +02:00
Volker Lendecke
29a51a22df s3: Avoid a lot of calls to serverid_exists()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jun  1 18:58:30 CEST 2012 on sn-devel-104
2012-06-01 18:58:30 +02:00
Volker Lendecke
58dff077d9 s3: Do not check the PIDs is parse_share_modes
We do that when conflicts arise

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Volker Lendecke
bc3b7d76a8 s3: Be less picky on stale share mode entries
If a process died, the share mode entry might be bogus. Ignore those entries.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Volker Lendecke
6666de1975 s3: Check for serverid_exists in rename_share_filename
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Jeremy Allison
6526432682 Fix an invalid state only reachable on server crash/abort.
Remove any delete-on-close tokens and clear the count if there are no
valid share modes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:37 -07:00
Volker Lendecke
5842d4e025 s3: Add "share_mode_stale_pid"
This is a helper routine that prunes a dead share mode entry on demand. This
prepares for removing the serverids_exist call in parse_share_modes.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:37 -07:00
Jeremy Allison
87a62df8e6 Raise the debug level from 1 to 5 in get_share_mode_lock_internal()
This isn't a fatal condition, there is a valid codepath
that can cause this message.
2012-05-18 19:33:37 -07:00
Volker Lendecke
f5ca3f11e4 s3: Revert the serverid changes, they need more work
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri May 18 13:12:14 CEST 2012 on sn-devel-104
2012-05-18 13:12:14 +02:00
Volker Lendecke
43296090f9 s3: Be less picky on stale share mode entries
If a process died, the share mode entry might be bogus. Ignore those entries.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:22 -07:00
Volker Lendecke
4e1656a782 s3: Check for serverid_exists in rename_share_filename
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:22 -07:00
Volker Lendecke
6379709b88 s3: Do not check the PIDs is parse_share_modes
We do that when conflicts arise

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:22 -07:00
Volker Lendecke
f45966d169 s3: Add "share_mode_stale_server"
This is a helper routine that prunes a dead share mode entry on demand. This
prepares for removing the serverids_exist call in parse_share_modes.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:21 -07:00
Volker Lendecke
997da4a28b s3: talloc_zero is not needed for structs we ndr_pull into
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Mon May 14 18:59:07 CEST 2012 on sn-devel-104
2012-05-14 18:59:07 +02:00
Volker Lendecke
393936aee6 s3: Fix Coverity ID 2682 -- NULL_RETURNS
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Apr 19 22:28:34 CEST 2012 on sn-devel-104
2012-04-19 22:28:34 +02:00
Jeremy Allison
989fc20fc3 Found whilst back-porting the fix for bug 8837 - smbd crashes when deleting directory and veto files are enabled.
The delete tokens are unique to each name hash representing a pathname,
if we don't correctly return here we'll add duplicate tokens for a
given pasname hash.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Apr  7 02:13:58 CEST 2012 on sn-devel-104
2012-04-07 02:13:58 +02:00
Andrew Bartlett
6aa12fcb30 build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr  6 01:47:43 CEST 2012 on sn-devel-104
2012-04-06 01:47:43 +02:00
Andrew Bartlett
1ac7f071ce build: Remove SMB_F* locking defines 2012-04-05 02:39:09 +02:00