cifs: make fs_context error logging wrapper
authorAurelien Aptel <aaptel@suse.com>
Mon, 1 Mar 2021 18:25:00 +0000 (19:25 +0100)
committerSteve French <stfrench@microsoft.com>
Sun, 25 Apr 2021 21:28:24 +0000 (16:28 -0500)
This new helper will be used in the fs_context mount option parsing
code. It log errors both in:
* the fs_context log queue for userspace to read
* kernel printk buffer (dmesg, old behaviour)

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/fs_context.h

index 87dd1f7168f26f8d111e6562636e9cfd06feacff..dc0b7c9489f588de6b82d5719f7ff87416086d74 100644 (file)
 #include <linux/parser.h>
 #include <linux/fs_parser.h>
 
-#define cifs_invalf(fc, fmt, ...) invalf(fc, fmt, ## __VA_ARGS__)
+/* Log errors in fs_context (new mount api) but also in dmesg (old style) */
+#define cifs_errorf(fc, fmt, ...)                      \
+       do {                                            \
+               errorf(fc, fmt, ## __VA_ARGS__);        \
+               cifs_dbg(VFS, fmt, ## __VA_ARGS__);     \
+       } while (0)
 
 enum smb_version {
        Smb_1 = 1,