Skip to content

Commit 2fb727c

Browse files
author
virco
committed
debug
1 parent b3c9884 commit 2fb727c

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RANLIB=ranlib
55
USESSL=mbed
66

77
#CFLAGS=-Wall -Wpointer-arith -O2 -g -fsanitize=address -mtune=core2
8-
CFLAGS=-Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2
8+
CFLAGS=-Wall -Wpointer-arith -O2 -g -fno-stack-protector -fomit-frame-pointer -mtune=core2 -I../sqlite
99
#CFLAGS=-O2 -g -pg
1010

1111
LIB_A=psynclib.a

pfs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,11 @@ int psync_fs_update_openfile(uint64_t taskid, uint64_t writeid, psync_fileid_t n
235235
psync_sql_bind_uint(res, 1, taskid);
236236
if ((row=psync_sql_fetch_rowint(res)) && row[0]==writeid)
237237
ret=0;
238-
else
238+
else{
239+
if (row)
240+
debug(D_NOTICE, "writeid of fileid %ld differs %lu!=%lu", (long)fileid, (unsigned long)row[0], (unsigned long)writeid);
239241
ret=-1;
242+
}
240243
psync_sql_free_result(res);
241244
psync_sql_unlock();
242245
return ret;

pfsupload.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static int save_meta(const binresult *meta, psync_folderid_t folderid, const cha
385385
psync_sql_bind_uint(sql, 2, writeid);
386386
psync_sql_run_free(sql);
387387
if (!psync_sql_affected_rows()){
388-
debug(D_BUG, "upload of %s cancelled due to writeid mismatch, psync_fs_update_openfile should have catched that", name);
388+
debug(D_BUG, "upload of %s cancelled due to writeid mismatch, writeid %lu, psync_fs_update_openfile should have catched that", name, (long unsigned)writeid);
389389
psync_sql_rollback_transaction();
390390
return -1;
391391
}
@@ -767,7 +767,7 @@ int upload_modify(uint64_t taskid, psync_folderid_t folderid, const char *name,
767767
psync_file_t fd;
768768
psync_fs_err_t err;
769769
int ret;
770-
debug(D_NOTICE, "uploading modified file %s as %lu/%s", filename, (unsigned long)folderid, name);
770+
debug(D_NOTICE, "uploading modified file %s writeid %lu as %lu/%s", filename, (unsigned long)writeid, (unsigned long)folderid, name);
771771
asize=0;
772772
fd=psync_file_open(indexname, P_O_RDONLY, 0);
773773
if (unlikely(fd==INVALID_HANDLE_VALUE)){

ppagecache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3023,7 +3023,7 @@ static void psync_pagecache_add_task(uint32_t type, uint64_t taskid, uint64_t ha
30233023
psync_sql_res *res;
30243024
int run;
30253025
// TODO: remove this check
3026-
if (type==PAGE_TASK_TYPE_MODIFY){
3026+
/* if (type==PAGE_TASK_TYPE_MODIFY){
30273027
res=psync_sql_prep_statement("DELETE FROM fstaskdepend WHERE dependfstaskid=?");
30283028
psync_sql_bind_uint(res, 1, taskid);
30293029
psync_sql_run_free(res);
@@ -3033,7 +3033,7 @@ static void psync_pagecache_add_task(uint32_t type, uint64_t taskid, uint64_t ha
30333033
psync_sql_bind_uint(res, 1, taskid);
30343034
psync_sql_run_free(res);
30353035
return;
3036-
}
3036+
}*/
30373037
run=0;
30383038
res=psync_sql_prep_statement("INSERT INTO pagecachetask (type, taskid, hash, oldhash) VALUES (?, ?, ?, ?)");
30393039
psync_sql_bind_uint(res, 1, type);

0 commit comments

Comments
 (0)