cifs: print more detail when invalidate_inode_mapping fails
authorSteve French <stfrench@microsoft.com>
Wed, 19 Jul 2023 02:20:13 +0000 (21:20 -0500)
committerSteve French <stfrench@microsoft.com>
Wed, 19 Jul 2023 02:20:52 +0000 (21:20 -0500)
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>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/inode.c

index 9a651df52e9a25d824fcfd340ec2f180c34f0492..7d7d4d2508626bb742f466c8f833b38ce33741b0 100644 (file)
@@ -2342,8 +2342,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);
        }
 
        cifs_fscache_reset_inode_cookie(inode);