Skip to content

Commit

Permalink
Merge tag '5.19-rc2-smb3-client-fixes' of git://git.samba.org/sfrench…
Browse files Browse the repository at this point in the history
…/cifs-2.6

Pull cifs client fixes from Steve French:
 "Two cifs debugging improvements - one found to deal with debugging a
  multichannel problem and one for a recent fallocate issue

  This does include the two larger multichannel reconnect (dynamically
  adjusting interfaces on reconnect) patches, because we recently found
  an additional problem with multichannel to one server type that I want
  to include at the same time"

* tag '5.19-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: when a channel is not found for server, log its connection id
  smb3: add trace point for SMB2_set_eof
  • Loading branch information
torvalds committed Jun 19, 2022
2 parents 4b35035 + 5d24968 commit ace2045
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/cifs/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ cifs_ses_get_chan_index(struct cifs_ses *ses,
}

/* If we didn't find the channel, it is likely a bug */
if (server)
cifs_dbg(VFS, "unable to get chan index for server: 0x%llx",
server->conn_id);
WARN_ON(1);
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions fs/cifs/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5154,6 +5154,8 @@ SMB2_set_eof(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
data = &info;
size = sizeof(struct smb2_file_eof_info);

trace_smb3_set_eof(xid, persistent_fid, tcon->tid, tcon->ses->Suid, le64_to_cpu(*eof));

return send_set_info(xid, tcon, persistent_fid, volatile_fid,
pid, FILE_END_OF_FILE_INFORMATION, SMB2_O_INFO_FILE,
0, 1, &data, &size);
Expand Down
38 changes: 38 additions & 0 deletions fs/cifs/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,44 @@ DEFINE_SMB3_RW_DONE_EVENT(query_dir_done);
DEFINE_SMB3_RW_DONE_EVENT(zero_done);
DEFINE_SMB3_RW_DONE_EVENT(falloc_done);

/* For logging successful set EOF (truncate) */
DECLARE_EVENT_CLASS(smb3_eof_class,
TP_PROTO(unsigned int xid,
__u64 fid,
__u32 tid,
__u64 sesid,
__u64 offset),
TP_ARGS(xid, fid, tid, sesid, offset),
TP_STRUCT__entry(
__field(unsigned int, xid)
__field(__u64, fid)
__field(__u32, tid)
__field(__u64, sesid)
__field(__u64, offset)
),
TP_fast_assign(
__entry->xid = xid;
__entry->fid = fid;
__entry->tid = tid;
__entry->sesid = sesid;
__entry->offset = offset;
),
TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx",
__entry->xid, __entry->sesid, __entry->tid, __entry->fid,
__entry->offset)
)

#define DEFINE_SMB3_EOF_EVENT(name) \
DEFINE_EVENT(smb3_eof_class, smb3_##name, \
TP_PROTO(unsigned int xid, \
__u64 fid, \
__u32 tid, \
__u64 sesid, \
__u64 offset), \
TP_ARGS(xid, fid, tid, sesid, offset))

DEFINE_SMB3_EOF_EVENT(set_eof);

/*
* For handle based calls other than read and write, and get/set info
*/
Expand Down

0 comments on commit ace2045

Please sign in to comment.