Index: drbd_main.c =================================================================== --- drbd_main.c (revision 3504) +++ drbd_main.c (working copy) @@ -131,7 +131,12 @@ // 0 = none // 1 = summary (trace 'interesting' packets in summary fmt) // 2 = verbose (trace all packets in full format) +int dump_packet_devs = 0;// bitmap of drbd devices to have tracing + // enabled + module_param(dump_packets,int,0644); +module_param(dump_packet_devs,int,0644); + #endif // devfs name @@ -306,11 +311,21 @@ hlist_for_each_entry(i, n, slot, colision) { if (i==req) { D_ASSERT(drbd_req_get_sector(i) == sector); + if (drbd_req_get_sector(i) != sector) { + ERR("tl_verify: found req %p but it has wrong sector (%llx versus %llx)\n", + req, (long long)drbd_req_get_sector(i), (long long)sector); + } rv=1; break; } } + // Really better find it! + if (!rv) { + ERR("tl_verify: failed to find req %p, sector %llx in list\n", + req, (long long)sector); + } + spin_unlock_irq(&mdev->tl_lock); return rv; @@ -1295,6 +1310,8 @@ down(&mdev->data.mutex); + dump_packet(mdev,mdev->data.socket,0,(void*)&h, __FILE__, __LINE__); + ok = ( sizeof(h) == drbd_send(mdev,mdev->data.socket,&h,sizeof(h),0) ); ok = ok && ( size == drbd_send(mdev,mdev->data.socket,data,size,0) ); @@ -1713,7 +1730,6 @@ unsigned int dp_flags=0; down(&mdev->data.mutex); - p.head.magic = BE_DRBD_MAGIC; p.head.command = cpu_to_be16(Data); p.head.length = cpu_to_be16( sizeof(p)-sizeof(Drbd_Header) @@ -2903,11 +2919,13 @@ if (dump_packets > DUMP_SUMMARY) { \ INFO("%s:%d: %s [%d] %s %s " fmt , \ file, line, current->comm, current->pid, \ - sockname, recv?"<<<":">>>" \ - , ## args ); \ + sockname, recv?"<<<":">>>", \ + ## args ); \ } \ else { \ - INFO("%s " fmt, recv?"<<<":">>>", ## args ); \ + INFO("%s %s " fmt, sockname, \ + recv?"<<<":">>>", \ + ## args ); \ } \ } while (0) @@ -2929,8 +2947,6 @@ break; case Data: - case DataReply: - case RSDataReply: INFOP("%s (sector %llx, id %llx, seq %x, f %x)\n", cmdname(cmd), (long long)be64_to_cpu(p->Data.sector), (long long)be64_to_cpu(p->Data.block_id), @@ -2939,6 +2955,14 @@ ); break; + case DataReply: + case RSDataReply: + INFOP("%s (sector %llx, id %llx)\n", cmdname(cmd), + (long long)be64_to_cpu(p->Data.sector), + (long long)be64_to_cpu(p->Data.block_id) + ); + break; + case RecvAck: case WriteAck: case NegAck: Index: drbd_int.h =================================================================== --- drbd_int.h (revision 3504) +++ drbd_int.h (working copy) @@ -1619,9 +1619,10 @@ #ifdef DUMP_EACH_PACKET /* - * variable that controls dumping + * variables that controls dumping */ extern int dump_packets; +extern int dump_packet_devs; #define DUMP_NONE 0 #define DUMP_SUMMARY 1 @@ -1638,7 +1639,8 @@ dump_packet(drbd_dev *mdev, struct socket *sock, int recv, Drbd_Polymorph_Packet *p, char* file, int line) { - if (dump_packets > DUMP_NONE) + if (dump_packets > DUMP_NONE && + ( ( 1 << (int)(mdev-drbd_conf)) & dump_packet_devs) ) _dump_packet(mdev,sock,recv,p,file,line); } #else