Commit f2bf09e9 authored by Steve French's avatar Steve French

cifs: Add tracepoints for errors on flush or fsync

Makes it easier to debug errors on writeback that happen later,
and are being returned on flush or fsync

For example:
  writetest-17829 [002] .... 13583.407859: cifs_flush_err: ino=90 rc=-28
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent d6fd4190
...@@ -2632,8 +2632,10 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) ...@@ -2632,8 +2632,10 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file); struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
rc = file_write_and_wait_range(file, start, end); rc = file_write_and_wait_range(file, start, end);
if (rc) if (rc) {
trace_cifs_fsync_err(file_inode(file)->i_ino, rc);
return rc; return rc;
}
xid = get_xid(); xid = get_xid();
...@@ -2666,7 +2668,8 @@ int cifs_flush(struct file *file, fl_owner_t id) ...@@ -2666,7 +2668,8 @@ int cifs_flush(struct file *file, fl_owner_t id)
rc = filemap_write_and_wait(inode->i_mapping); rc = filemap_write_and_wait(inode->i_mapping);
cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc); cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc);
if (rc)
trace_cifs_flush_err(inode->i_ino, rc);
return rc; return rc;
} }
......
...@@ -547,6 +547,33 @@ DEFINE_EVENT(smb3_exit_err_class, smb3_##name, \ ...@@ -547,6 +547,33 @@ DEFINE_EVENT(smb3_exit_err_class, smb3_##name, \
DEFINE_SMB3_EXIT_ERR_EVENT(exit_err); DEFINE_SMB3_EXIT_ERR_EVENT(exit_err);
DECLARE_EVENT_CLASS(smb3_sync_err_class,
TP_PROTO(unsigned long ino,
int rc),
TP_ARGS(ino, rc),
TP_STRUCT__entry(
__field(unsigned long, ino)
__field(int, rc)
),
TP_fast_assign(
__entry->ino = ino;
__entry->rc = rc;
),
TP_printk("\tino=%lu rc=%d",
__entry->ino, __entry->rc)
)
#define DEFINE_SMB3_SYNC_ERR_EVENT(name) \
DEFINE_EVENT(smb3_sync_err_class, cifs_##name, \
TP_PROTO(unsigned long ino, \
int rc), \
TP_ARGS(ino, rc))
DEFINE_SMB3_SYNC_ERR_EVENT(fsync_err);
DEFINE_SMB3_SYNC_ERR_EVENT(flush_err);
DECLARE_EVENT_CLASS(smb3_enter_exit_class, DECLARE_EVENT_CLASS(smb3_enter_exit_class,
TP_PROTO(unsigned int xid, TP_PROTO(unsigned int xid,
const char *func_name), const char *func_name),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment