aboutsummaryrefslogtreecommitdiffstats
path: root/module/spl/spl-generic.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-04-22 12:48:40 -0700
committerBrian Behlendorf <[email protected]>2010-04-22 12:53:58 -0700
commit82a358d9c0750a84232adf5c092aeec339c9dd3a (patch)
treee2441f69955f7fd0ea2b52d25caaf5b07e271fc6 /module/spl/spl-generic.c
parentef6c1368848f364ac08ccba60bb88010548d9930 (diff)
Update vn_set_pwd() to allow user|kernal address for filename
During module init spl_setup()->The vn_set_pwd("/") was failing with -EFAULT because user_path_dir() and __user_walk() both expect 'filename' to be a user space address and it's not in this case. To handle this the data segment size is increased to to ensure strncpy_from_user() does not fail with -EFAULT. Additionally, I've added a printk() warning to catch this and log it to the console if it ever reoccurs. I thought everything was working properly here because there consequences of this failing are subtle and usually non-critical.
Diffstat (limited to 'module/spl/spl-generic.c')
-rw-r--r--module/spl/spl-generic.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c
index 290c5275d..aaf1a4c10 100644
--- a/module/spl/spl-generic.c
+++ b/module/spl/spl-generic.c
@@ -444,12 +444,16 @@ spl_fini(void)
void
spl_setup(void)
{
+ int rc;
+
/*
* At module load time the pwd is set to '/' on a Solaris system.
* On a Linux system will be set to whatever directory the caller
* was in when executing insmod/modprobe.
*/
- vn_set_pwd("/");
+ rc = vn_set_pwd("/");
+ if (rc)
+ printk("SPL: Warning unable to set pwd to '/': %d\n", rc);
}
EXPORT_SYMBOL(spl_setup);