diff mbox series

[SMB,CLIENT] print more detail when invalide_inode_pages fails

Message ID CAH2r5mvpS+XPMe_taXe7W8fc2GaG9eKVMXtUZQPg3AzY-QKdMg@mail.gmail.com
State New
Headers show
Series [SMB,CLIENT] print more detail when invalide_inode_pages fails | expand

Commit Message

Steve French June 20, 2023, 1:52 a.m. UTC
We had seen cases where cifs_invalidate_mapping was logging:
       "Could not invalidate inode ..."
    if invalidate_inode_pages2 fails but this message does not show what
    the rc is.  Update the logged message to also log the return code.

    Suggested-by: Shyam Prasad N <sprasad@microsoft.com>

(see attached)

Comments

Shyam Prasad N June 20, 2023, 7:49 a.m. UTC | #1
On Tue, Jun 20, 2023 at 7:22 AM Steve French <smfrench@gmail.com> wrote:
>
>     We had seen cases where cifs_invalidate_mapping was logging:
>        "Could not invalidate inode ..."
>     if invalidate_inode_pages2 fails but this message does not show what
>     the rc is.  Update the logged message to also log the return code.
>
>     Suggested-by: Shyam Prasad N <sprasad@microsoft.com>
>
> (see attached)
>
> --
> Thanks,
>
> Steve

Looks good to me.
Tom Talpey June 21, 2023, 6:28 p.m. UTC | #2
On 6/19/2023 9:52 PM, Steve French wrote:
>      We had seen cases where cifs_invalidate_mapping was logging:
>         "Could not invalidate inode ..."
>      if invalidate_inode_pages2 fails but this message does not show what
>      the rc is.  Update the logged message to also log the return code.
> 
>      Suggested-by: Shyam Prasad N <sprasad@microsoft.com>
> 
> (see attached)
> 

It's reasonable, but should we be printing kernel addresses like this?
Thinking Spectre, and all.

Wouldn't printing the inode number etc be more useful?

Tom.
diff mbox series

Patch

From bbe496a9e50bf95824a6199a433ebd1262b95cff Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Mon, 19 Jun 2023 20:45:33 -0500
Subject: [PATCH] cifs: print more detail when invalidate_inode_mapping fails

We had seen cases where cifs_invalidate_mapping was logging:
   "Could not invalidate inode ..."
if invalidate_inode_pages2 fails but this message does not show what
the rc is.  Update the logged message to also log the return code.

Suggested-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/smb/client/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index 1087ac6104a9..c3eeae07e139 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -2344,8 +2344,8 @@  cifs_invalidate_mapping(struct inode *inode)
 	if (inode->i_mapping && inode->i_mapping->nrpages != 0) {
 		rc = invalidate_inode_pages2(inode->i_mapping);
 		if (rc)
-			cifs_dbg(VFS, "%s: Could not invalidate inode %p\n",
-				 __func__, inode);
+			cifs_dbg(VFS, "%s: invalidate inode %p failed with rc %d\n",
+				 __func__, inode, rc);
 	}
 
 	return rc;
-- 
2.34.1