summaryrefslogtreecommitdiff
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2020-02-06 03:22:37 +0300
committerSteve French <stfrench@microsoft.com>2020-02-06 03:24:19 +0300
commitf2bf09e97b47c7b13e8a918f560f6082e9bc8f8a (patch)
treed8cf7657f023c69359dbc58831778108e75c51eb /fs/cifs/file.c
parentd6fd41905ec577851734623fb905b1763801f5ef (diff)
downloadlinux-f2bf09e97b47c7b13e8a918f560f6082e9bc8f8a.tar.xz
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: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 79e6f4f55b9b..99ea7b2a06a5 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -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);
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;
+ }
xid = get_xid();
@@ -2666,7 +2668,8 @@ int cifs_flush(struct file *file, fl_owner_t id)
rc = filemap_write_and_wait(inode->i_mapping);
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;
}