s3:smbd: add debugging to close code (regarding disconnect of a durable)
authorMichael Adam <obnox@samba.org>
Tue, 12 Feb 2013 16:44:51 +0000 (17:44 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Feb 2013 16:42:45 +0000 (17:42 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Feb 18 17:42:45 CET 2013 on sn-devel-104

source3/smbd/close.c

index 9e7ccc7c05224152c13420145a2afb1f2a0df7c2..df3ae23a92ae526afe3cb1167e42e037b62464fd 100644 (file)
@@ -783,6 +783,17 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp,
                        fsp->op->global->backend_cookie = new_cookie;
 
                        tmp = smbXsrv_open_close(fsp->op, now);
+                       if (!NT_STATUS_IS_OK(tmp)) {
+                               DEBUG(1, ("Failed to update smbXsrv_open "
+                                         "record when disconnecting durable "
+                                         "handle for file %s: %s - "
+                                         "proceeding with normal close\n",
+                                         fsp_str_dbg(fsp), nt_errstr(tmp)));
+                       }
+               } else {
+                       DEBUG(1, ("Failed to disconnect durable handle for "
+                                 "file %s: %s - proceeding with normal "
+                                 "close\n", fsp_str_dbg(fsp), nt_errstr(tmp)));
                }
                if (!NT_STATUS_IS_OK(tmp)) {
                        is_durable = false;
@@ -795,6 +806,9 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp,
                 * a durable handle and closed the underlying file.
                 * In all other cases, we proceed with a genuine close.
                 */
+               DEBUG(10, ("%s disconnected durable handle for file %s\n",
+                          conn->session_info->unix_info->unix_name,
+                          fsp_str_dbg(fsp)));
                file_free(req, fsp);
                return NT_STATUS_OK;
        }