2 trivial patches here, suitable for 3.6:
- fix spelling error in comment s/control/control
- add write size attempted to log warning issued for E2BIG error
Fix a comment referring to <debugfs>/dynamic_debug/conrol.
It should be control.
Signed-off-by: Jim Cromie <[email protected]>
---
lib/dynamic_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 7ca29a0..86d4065 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -630,7 +630,7 @@ static __init int ddebug_setup_query(char *str)
__setup("ddebug_query=", ddebug_setup_query);
/*
- * File_ops->write method for <debugfs>/dynamic_debug/conrol. Gathers the
+ * File_ops->write method for <debugfs>/dynamic_debug/control. Gathers the
* command text from userspace, parses and executes it.
*/
#define USER_BUF_PAGE 4096
--
1.7.10.1.487.ga3935e6
ddebug_proc_write() warns if the written buffer is >4096 bytes.
Might as well tell user how much was attempted, in case its not obvious.
Signed-off-by: Jim Cromie <[email protected]>
---
lib/dynamic_debug.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 86d4065..0983f60 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -643,7 +643,8 @@ static ssize_t ddebug_proc_write(struct file *file, const char __user *ubuf,
if (len == 0)
return 0;
if (len > USER_BUF_PAGE - 1) {
- pr_warn("expected <%d bytes into control\n", USER_BUF_PAGE);
+ pr_warn("expected <%d bytes into control, you wrote %d\n",
+ USER_BUF_PAGE, len);
return -E2BIG;
}
tmpbuf = kmalloc(len + 1, GFP_KERNEL);
--
1.7.10.1.487.ga3935e6
On Thu, Aug 16, 2012 at 08:37:21PM -0600, Jim Cromie wrote:
> 2 trivial patches here, suitable for 3.6:
> - fix spelling error in comment s/control/control
That's not for 3.6, that's 3.7, at the earliest.
> - add write size attempted to log warning issued for E2BIG error
Same here.
greg k-h