Re: [CIFS][PATCH] Add dynamic trace points for flush and fsync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



cifs_strict_fsync already gets traced for most cases for entry and
exit since we have a dynamic trace point in get_xid and free_xid (for
enter and exit) ie trace_smb3_enter and trace_smb3_exit and
trace_smb3_exit_err




On Thu, Feb 6, 2020 at 12:17 PM Pavel Shilovsky <piastryyy@xxxxxxxxx> wrote:
>
> ср, 5 февр. 2020 г. в 16:32, Steve French <smfrench@xxxxxxxxx>:
> >
> > 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
>
> The patch is missing to add a similar tracepoint to cifs_strict_fsync().
>
> --
> Best regards,
> Pavel Shilovsky



-- 
Thanks,

Steve
From 242891c4d6e23d0517441cc49ac131a9e5bb3791 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@xxxxxxxxxxxxx>
Date: Thu, 6 Feb 2020 16:04:59 -0600
Subject: [PATCH] smb3: add one more dynamic tracepoint missing from strict
 fsync path

We didn't have a dynamic trace point for catching errors in
file_write_and_wait_range error cases in cifs_strict_fsync.

Since not all apps check for write behind errors, it can be
important for debugging to be able to trace these error
paths.

Suggested-and-reviewed-by: Pavel Shilovsky <pshilov@xxxxxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
---
 fs/cifs/file.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 99ea7b2a06a5..bc9516ab4b34 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2593,8 +2593,10 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
 	struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
 
 	rc = file_write_and_wait_range(file, start, end);
-	if (rc)
+	if (rc) {
+		trace_cifs_fsync_err(inode->i_ino, rc);
 		return rc;
+	}
 
 	xid = get_xid();
 
-- 
2.20.1


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux