TMP smb2 durable reopen add some debug
authorMichael Adam <obnox@samba.org>
Thu, 23 Feb 2012 00:27:17 +0000 (01:27 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 10 May 2012 16:41:58 +0000 (18:41 +0200)
source3/smbd/smb2_create.c

index e62d881f54bf929c19e06aff024f83e722d7200d..abe2e925817b2e5363e09f0b5b8d97f0afccece7 100644 (file)
@@ -482,11 +482,13 @@ DEBUG(0, ("OBNOX - durable_reconnect enter: (%s:%s)\n", __location__, __FUNCTION
                                        op->global->backend_file_id);
        if (sharemode_lock == NULL) {
                /* TODO: use/create other fetch func with better error code */
+DEBUG(0, ("OBNOX - durable_reconnect: share-mode lock not obtained from db (%s:%s)\n", __location__, __FUNCTION__));
                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
        }
 
        if (sharemode_lock->data->num_share_modes == 0) {
                /* should not happen? internal error? */
+DEBUG(0, ("OBNOX - durable_reconnect: no share-mode entry (%s:%s)\n", __location__, __FUNCTION__));
                return NT_STATUS_INTERNAL_DB_ERROR;
        }
 
@@ -495,6 +497,7 @@ DEBUG(0, ("OBNOX - durable_reconnect enter: (%s:%s)\n", __location__, __FUNCTION
                 * It can't be durable if there is more than one handle
                 * on the file.
                 */
+DEBUG(0, ("OBNOX - durable_reconnect: more than one share-mode entry - can't be durable (%s:%s)\n", __location__, __FUNCTION__));
                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
        }
 
@@ -504,6 +507,7 @@ DEBUG(0, ("OBNOX - durable_reconnect enter: (%s:%s)\n", __location__, __FUNCTION
                 * TODO: check whether session exists
                 *  (could have been a session_logoff())
                 */
+DEBUG(0, ("OBNOX - durable_reconnect: serverid exists - denying access to durable (%s:%s)\n", __location__, __FUNCTION__));
                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
        }
 
@@ -529,6 +533,7 @@ DEBUG(0, ("OBNOX - durable_reconnect enter: (%s:%s)\n", __location__, __FUNCTION
         */
        status = new_durable_reconnect_fsp(op, conn, smb_fname, conn, &fsp);
        if (!NT_STATUS_IS_OK(status)) {
+DEBUG(0, ("OBNOX - durable_reconnect: failed to create new fsp: %s (%s:%s)\n", nt_errstr(status), __location__, __FUNCTION__));
                return status;
        }
 
@@ -540,10 +545,13 @@ DEBUG(0, ("OBNOX - durable_reconnect: new fsp created (%s:%s)\n", __location__,
                                   sharemode_lock->data->share_modes[0].flags,
                                   0 /* mode */);
        if (fsp->fh->fd == -1) {
+DEBUG(0, ("OBNOX - durable_reconnect: failed to open file: %s (%s:%s)\n", nt_errstr(status), __location__, __FUNCTION__));
                status = map_nt_error_from_unix(errno);
                return status;
        }
 
+DEBUG(0, ("OBNOX - durable_reconnect: opened file (%s:%s)\n", __location__, __FUNCTION__));
+
        /* - release the sharemode lock: this writes the changes */
        talloc_free(sharemode_lock);