Skip to content

Commit 11f8b80

Browse files
Ruben Devossmfrench
authored andcommitted
smb: client: fix order of arguments of tracepoints
The tracepoints based on smb3_inf_compound_*_class have tcon id and session id swapped around. This results in incorrect output in `trace-cmd report`. Fix the order of arguments to resolve this issue. The trace-cmd output below shows the before and after of the smb3_delete_enter and smb3_delete_done events as an example. The smb3_cmd_* events show the correct session and tcon id for reference. Also fix tracepoint set -> get in the SMB2_OP_GET_REPARSE case. BEFORE: rm-2211 [001] ..... 1839.550888: smb3_delete_enter: xid=281 sid=0x5 tid=0x3d path=\hello2.txt rm-2211 [001] ..... 1839.550894: smb3_cmd_enter: sid=0x1ac000000003d tid=0x5 cmd=5 mid=61 rm-2211 [001] ..... 1839.550896: smb3_cmd_enter: sid=0x1ac000000003d tid=0x5 cmd=6 mid=62 rm-2211 [001] ..... 1839.552091: smb3_cmd_done: sid=0x1ac000000003d tid=0x5 cmd=5 mid=61 rm-2211 [001] ..... 1839.552093: smb3_cmd_done: sid=0x1ac000000003d tid=0x5 cmd=6 mid=62 rm-2211 [001] ..... 1839.552103: smb3_delete_done: xid=281 sid=0x5 tid=0x3d AFTER: rm-2501 [001] ..... 3237.656110: smb3_delete_enter: xid=88 sid=0x1ac0000000041 tid=0x5 path=\hello2.txt rm-2501 [001] ..... 3237.656122: smb3_cmd_enter: sid=0x1ac0000000041 tid=0x5 cmd=5 mid=84 rm-2501 [001] ..... 3237.656123: smb3_cmd_enter: sid=0x1ac0000000041 tid=0x5 cmd=6 mid=85 rm-2501 [001] ..... 3237.657909: smb3_cmd_done: sid=0x1ac0000000041 tid=0x5 cmd=5 mid=84 rm-2501 [001] ..... 3237.657909: smb3_cmd_done: sid=0x1ac0000000041 tid=0x5 cmd=6 mid=85 rm-2501 [001] ..... 3237.657922: smb3_delete_done: xid=88 sid=0x1ac0000000041 tid=0x5 Cc: [email protected] Signed-off-by: Ruben Devos <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent be7a6a7 commit 11f8b80

File tree

2 files changed

+57
-57
lines changed

2 files changed

+57
-57
lines changed

fs/smb/client/dir.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,17 +627,17 @@ int cifs_mknod(struct mnt_idmap *idmap, struct inode *inode,
627627
goto mknod_out;
628628
}
629629

630-
trace_smb3_mknod_enter(xid, tcon->ses->Suid, tcon->tid, full_path);
630+
trace_smb3_mknod_enter(xid, tcon->tid, tcon->ses->Suid, full_path);
631631

632632
rc = tcon->ses->server->ops->make_node(xid, inode, direntry, tcon,
633633
full_path, mode,
634634
device_number);
635635

636636
mknod_out:
637637
if (rc)
638-
trace_smb3_mknod_err(xid, tcon->ses->Suid, tcon->tid, rc);
638+
trace_smb3_mknod_err(xid, tcon->tid, tcon->ses->Suid, rc);
639639
else
640-
trace_smb3_mknod_done(xid, tcon->ses->Suid, tcon->tid);
640+
trace_smb3_mknod_done(xid, tcon->tid, tcon->ses->Suid);
641641

642642
free_dentry_path(page);
643643
free_xid(xid);

fs/smb/client/smb2inode.c

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
298298
goto finished;
299299
}
300300
num_rqst++;
301-
trace_smb3_query_info_compound_enter(xid, ses->Suid,
302-
tcon->tid, full_path);
301+
trace_smb3_query_info_compound_enter(xid, tcon->tid,
302+
ses->Suid, full_path);
303303
break;
304304
case SMB2_OP_POSIX_QUERY_INFO:
305305
rqst[num_rqst].rq_iov = &vars->qi_iov;
@@ -334,18 +334,18 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
334334
goto finished;
335335
}
336336
num_rqst++;
337-
trace_smb3_posix_query_info_compound_enter(xid, ses->Suid,
338-
tcon->tid, full_path);
337+
trace_smb3_posix_query_info_compound_enter(xid, tcon->tid,
338+
ses->Suid, full_path);
339339
break;
340340
case SMB2_OP_DELETE:
341-
trace_smb3_delete_enter(xid, ses->Suid, tcon->tid, full_path);
341+
trace_smb3_delete_enter(xid, tcon->tid, ses->Suid, full_path);
342342
break;
343343
case SMB2_OP_MKDIR:
344344
/*
345345
* Directories are created through parameters in the
346346
* SMB2_open() call.
347347
*/
348-
trace_smb3_mkdir_enter(xid, ses->Suid, tcon->tid, full_path);
348+
trace_smb3_mkdir_enter(xid, tcon->tid, ses->Suid, full_path);
349349
break;
350350
case SMB2_OP_RMDIR:
351351
rqst[num_rqst].rq_iov = &vars->si_iov[0];
@@ -363,7 +363,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
363363
goto finished;
364364
smb2_set_next_command(tcon, &rqst[num_rqst]);
365365
smb2_set_related(&rqst[num_rqst++]);
366-
trace_smb3_rmdir_enter(xid, ses->Suid, tcon->tid, full_path);
366+
trace_smb3_rmdir_enter(xid, tcon->tid, ses->Suid, full_path);
367367
break;
368368
case SMB2_OP_SET_EOF:
369369
rqst[num_rqst].rq_iov = &vars->si_iov[0];
@@ -398,7 +398,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
398398
goto finished;
399399
}
400400
num_rqst++;
401-
trace_smb3_set_eof_enter(xid, ses->Suid, tcon->tid, full_path);
401+
trace_smb3_set_eof_enter(xid, tcon->tid, ses->Suid, full_path);
402402
break;
403403
case SMB2_OP_SET_INFO:
404404
rqst[num_rqst].rq_iov = &vars->si_iov[0];
@@ -429,8 +429,8 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
429429
goto finished;
430430
}
431431
num_rqst++;
432-
trace_smb3_set_info_compound_enter(xid, ses->Suid,
433-
tcon->tid, full_path);
432+
trace_smb3_set_info_compound_enter(xid, tcon->tid,
433+
ses->Suid, full_path);
434434
break;
435435
case SMB2_OP_RENAME:
436436
rqst[num_rqst].rq_iov = &vars->si_iov[0];
@@ -469,7 +469,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
469469
goto finished;
470470
}
471471
num_rqst++;
472-
trace_smb3_rename_enter(xid, ses->Suid, tcon->tid, full_path);
472+
trace_smb3_rename_enter(xid, tcon->tid, ses->Suid, full_path);
473473
break;
474474
case SMB2_OP_HARDLINK:
475475
rqst[num_rqst].rq_iov = &vars->si_iov[0];
@@ -496,7 +496,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
496496
goto finished;
497497
smb2_set_next_command(tcon, &rqst[num_rqst]);
498498
smb2_set_related(&rqst[num_rqst++]);
499-
trace_smb3_hardlink_enter(xid, ses->Suid, tcon->tid, full_path);
499+
trace_smb3_hardlink_enter(xid, tcon->tid, ses->Suid, full_path);
500500
break;
501501
case SMB2_OP_SET_REPARSE:
502502
rqst[num_rqst].rq_iov = vars->io_iov;
@@ -523,8 +523,8 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
523523
goto finished;
524524
}
525525
num_rqst++;
526-
trace_smb3_set_reparse_compound_enter(xid, ses->Suid,
527-
tcon->tid, full_path);
526+
trace_smb3_set_reparse_compound_enter(xid, tcon->tid,
527+
ses->Suid, full_path);
528528
break;
529529
case SMB2_OP_GET_REPARSE:
530530
rqst[num_rqst].rq_iov = vars->io_iov;
@@ -549,8 +549,8 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
549549
goto finished;
550550
}
551551
num_rqst++;
552-
trace_smb3_get_reparse_compound_enter(xid, ses->Suid,
553-
tcon->tid, full_path);
552+
trace_smb3_get_reparse_compound_enter(xid, tcon->tid,
553+
ses->Suid, full_path);
554554
break;
555555
case SMB2_OP_QUERY_WSL_EA:
556556
rqst[num_rqst].rq_iov = &vars->ea_iov;
@@ -656,11 +656,11 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
656656
}
657657
SMB2_query_info_free(&rqst[num_rqst++]);
658658
if (rc)
659-
trace_smb3_query_info_compound_err(xid, ses->Suid,
660-
tcon->tid, rc);
659+
trace_smb3_query_info_compound_err(xid, tcon->tid,
660+
ses->Suid, rc);
661661
else
662-
trace_smb3_query_info_compound_done(xid, ses->Suid,
663-
tcon->tid);
662+
trace_smb3_query_info_compound_done(xid, tcon->tid,
663+
ses->Suid);
664664
break;
665665
case SMB2_OP_POSIX_QUERY_INFO:
666666
idata = in_iov[i].iov_base;
@@ -683,75 +683,75 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
683683

684684
SMB2_query_info_free(&rqst[num_rqst++]);
685685
if (rc)
686-
trace_smb3_posix_query_info_compound_err(xid, ses->Suid,
687-
tcon->tid, rc);
686+
trace_smb3_posix_query_info_compound_err(xid, tcon->tid,
687+
ses->Suid, rc);
688688
else
689-
trace_smb3_posix_query_info_compound_done(xid, ses->Suid,
690-
tcon->tid);
689+
trace_smb3_posix_query_info_compound_done(xid, tcon->tid,
690+
ses->Suid);
691691
break;
692692
case SMB2_OP_DELETE:
693693
if (rc)
694-
trace_smb3_delete_err(xid, ses->Suid, tcon->tid, rc);
694+
trace_smb3_delete_err(xid, tcon->tid, ses->Suid, rc);
695695
else {
696696
/*
697697
* If dentry (hence, inode) is NULL, lease break is going to
698698
* take care of degrading leases on handles for deleted files.
699699
*/
700700
if (inode)
701701
cifs_mark_open_handles_for_deleted_file(inode, full_path);
702-
trace_smb3_delete_done(xid, ses->Suid, tcon->tid);
702+
trace_smb3_delete_done(xid, tcon->tid, ses->Suid);
703703
}
704704
break;
705705
case SMB2_OP_MKDIR:
706706
if (rc)
707-
trace_smb3_mkdir_err(xid, ses->Suid, tcon->tid, rc);
707+
trace_smb3_mkdir_err(xid, tcon->tid, ses->Suid, rc);
708708
else
709-
trace_smb3_mkdir_done(xid, ses->Suid, tcon->tid);
709+
trace_smb3_mkdir_done(xid, tcon->tid, ses->Suid);
710710
break;
711711
case SMB2_OP_HARDLINK:
712712
if (rc)
713-
trace_smb3_hardlink_err(xid, ses->Suid, tcon->tid, rc);
713+
trace_smb3_hardlink_err(xid, tcon->tid, ses->Suid, rc);
714714
else
715-
trace_smb3_hardlink_done(xid, ses->Suid, tcon->tid);
715+
trace_smb3_hardlink_done(xid, tcon->tid, ses->Suid);
716716
SMB2_set_info_free(&rqst[num_rqst++]);
717717
break;
718718
case SMB2_OP_RENAME:
719719
if (rc)
720-
trace_smb3_rename_err(xid, ses->Suid, tcon->tid, rc);
720+
trace_smb3_rename_err(xid, tcon->tid, ses->Suid, rc);
721721
else
722-
trace_smb3_rename_done(xid, ses->Suid, tcon->tid);
722+
trace_smb3_rename_done(xid, tcon->tid, ses->Suid);
723723
SMB2_set_info_free(&rqst[num_rqst++]);
724724
break;
725725
case SMB2_OP_RMDIR:
726726
if (rc)
727-
trace_smb3_rmdir_err(xid, ses->Suid, tcon->tid, rc);
727+
trace_smb3_rmdir_err(xid, tcon->tid, ses->Suid, rc);
728728
else
729-
trace_smb3_rmdir_done(xid, ses->Suid, tcon->tid);
729+
trace_smb3_rmdir_done(xid, tcon->tid, ses->Suid);
730730
SMB2_set_info_free(&rqst[num_rqst++]);
731731
break;
732732
case SMB2_OP_SET_EOF:
733733
if (rc)
734-
trace_smb3_set_eof_err(xid, ses->Suid, tcon->tid, rc);
734+
trace_smb3_set_eof_err(xid, tcon->tid, ses->Suid, rc);
735735
else
736-
trace_smb3_set_eof_done(xid, ses->Suid, tcon->tid);
736+
trace_smb3_set_eof_done(xid, tcon->tid, ses->Suid);
737737
SMB2_set_info_free(&rqst[num_rqst++]);
738738
break;
739739
case SMB2_OP_SET_INFO:
740740
if (rc)
741-
trace_smb3_set_info_compound_err(xid, ses->Suid,
742-
tcon->tid, rc);
741+
trace_smb3_set_info_compound_err(xid, tcon->tid,
742+
ses->Suid, rc);
743743
else
744-
trace_smb3_set_info_compound_done(xid, ses->Suid,
745-
tcon->tid);
744+
trace_smb3_set_info_compound_done(xid, tcon->tid,
745+
ses->Suid);
746746
SMB2_set_info_free(&rqst[num_rqst++]);
747747
break;
748748
case SMB2_OP_SET_REPARSE:
749749
if (rc) {
750-
trace_smb3_set_reparse_compound_err(xid, ses->Suid,
751-
tcon->tid, rc);
750+
trace_smb3_set_reparse_compound_err(xid, tcon->tid,
751+
ses->Suid, rc);
752752
} else {
753-
trace_smb3_set_reparse_compound_done(xid, ses->Suid,
754-
tcon->tid);
753+
trace_smb3_set_reparse_compound_done(xid, tcon->tid,
754+
ses->Suid);
755755
}
756756
SMB2_ioctl_free(&rqst[num_rqst++]);
757757
break;
@@ -764,18 +764,18 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
764764
rbuf = reparse_buf_ptr(iov);
765765
if (IS_ERR(rbuf)) {
766766
rc = PTR_ERR(rbuf);
767-
trace_smb3_set_reparse_compound_err(xid, ses->Suid,
768-
tcon->tid, rc);
767+
trace_smb3_get_reparse_compound_err(xid, tcon->tid,
768+
ses->Suid, rc);
769769
} else {
770770
idata->reparse.tag = le32_to_cpu(rbuf->ReparseTag);
771-
trace_smb3_set_reparse_compound_done(xid, ses->Suid,
772-
tcon->tid);
771+
trace_smb3_get_reparse_compound_done(xid, tcon->tid,
772+
ses->Suid);
773773
}
774774
memset(iov, 0, sizeof(*iov));
775775
resp_buftype[i + 1] = CIFS_NO_BUFFER;
776776
} else {
777-
trace_smb3_set_reparse_compound_err(xid, ses->Suid,
778-
tcon->tid, rc);
777+
trace_smb3_get_reparse_compound_err(xid, tcon->tid,
778+
ses->Suid, rc);
779779
}
780780
SMB2_ioctl_free(&rqst[num_rqst++]);
781781
break;
@@ -792,11 +792,11 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
792792
}
793793
}
794794
if (!rc) {
795-
trace_smb3_query_wsl_ea_compound_done(xid, ses->Suid,
796-
tcon->tid);
795+
trace_smb3_query_wsl_ea_compound_done(xid, tcon->tid,
796+
ses->Suid);
797797
} else {
798-
trace_smb3_query_wsl_ea_compound_err(xid, ses->Suid,
799-
tcon->tid, rc);
798+
trace_smb3_query_wsl_ea_compound_err(xid, tcon->tid,
799+
ses->Suid, rc);
800800
}
801801
SMB2_query_info_free(&rqst[num_rqst++]);
802802
break;

0 commit comments

Comments
 (0)