procfs vs. kernel threads (was: Re: test1-ac10 and bttv)

From: almesber@lrc.di.epfl.ch
Date: Wed Jun 07 2000 - 02:40:52 EST


Here's the promised patch. fs->root and fs->rootmnt are NULL when a
kernel thread is launched before current->fs is properly initialized.
(E.g. msp3400 when not using modules.) After applying John's patch to
videodev.c, my patch to i2c-old.c, and this one, I can watch TV
again ;-)

proc_cwd_link looks a little suspicious to me too, but I haven't been
able to get it to cause any oops, so it may be safe.

Sigh, if we just had that little FS jail ...

- Werner

---------------------------------- cut here -----------------------------------

--- orig/fs/proc/base.c Mon May 22 05:34:37 2000
+++ linux/fs/proc/base.c Wed Jun 7 15:13:01 2000
@@ -118,7 +118,7 @@
         if(fs)
                 atomic_inc(&fs->count);
         task_unlock(inode->u.proc_i.task);
- if (fs) {
+ if (fs && fs->root) {
                 *mnt = mntget(fs->rootmnt);
                 *dentry = dget(fs->root);
                 result = 0;

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger@ica.epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:27 EST