summaryrefslogtreecommitdiffstats
path: root/source3/locking/posix.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-11-10 23:11:54 +0100
committerMichael Adam <obnox@samba.org>2011-11-25 14:59:53 +0100
commit37f7a2c82d76fd5b9997686d8cbf1cf8a2180aac (patch)
treedbab0d9363189d055c4d435c69dd42d3d337a1b7 /source3/locking/posix.c
parent95e686d59c2e712b4e030c770a37dde18837e222 (diff)
downloadsamba-37f7a2c82d76fd5b9997686d8cbf1cf8a2180aac.tar.gz
samba-37f7a2c82d76fd5b9997686d8cbf1cf8a2180aac.tar.xz
samba-37f7a2c82d76fd5b9997686d8cbf1cf8a2180aac.zip
s3:locking:posix: remove uses of SMB_ASSERT() from get_windows_lock_ref_count()
SMB_ASSERT is useless, since in non-developer build it does not actually fail after the log message, but usual flow just continues. Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Nov 25 14:59:53 CET 2011 on sn-devel-104
Diffstat (limited to 'source3/locking/posix.c')
-rw-r--r--source3/locking/posix.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index 3a8b1635d8c..0ff2395d60c 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -517,9 +517,20 @@ static int get_windows_lock_ref_count(files_struct *fsp)
goto done;
}
- SMB_ASSERT(NT_STATUS_IS_OK(status));
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("get_windows_lock_ref_count: Error fetching "
+ "lock ref count for file %s: %s\n",
+ fsp_str_dbg(fsp), nt_errstr(status)));
+ goto done;
+ }
- SMB_ASSERT(dbuf.dsize == sizeof(lock_ref_count));
+ if (dbuf.dsize != sizeof(lock_ref_count)) {
+ DEBUG(0, ("get_windows_lock_ref_count: invalid entry "
+ "in lock ref count record for file %s: "
+ "(invalid data size %u)\n",
+ fsp_str_dbg(fsp), (unsigned int)dbuf.dsize));
+ goto done;
+ }
memcpy(&lock_ref_count, dbuf.dptr, sizeof(lock_ref_count));
TALLOC_FREE(dbuf.dptr);