--- 1/fs/namei.c 2004-02-03 14:35:16.000000000 +0200 +++ 2/fs/namei.c 2004-02-03 17:20:21.000000000 +0200 @@ -1240,7 +1240,7 @@ int open_namei(const char * pathname, in int acc_mode, error = 0; struct dentry *dentry; struct dentry *dir; - int count = 0; + int count = 0, retry = 0; acc_mode = ACC_MODE(flag); @@ -1253,13 +1253,14 @@ int open_namei(const char * pathname, in nd->intent.open.flags = flag; nd->intent.open.create_mode = mode; +retry_open: /* * The simplest case - just a plain lookup. */ if (!(flag & O_CREAT)) { error = path_lookup(pathname, lookup_flags(flag)|LOOKUP_OPEN, nd); if (error) - return error; + goto error; dentry = nd->dentry; goto ok; } @@ -1269,7 +1270,7 @@ int open_namei(const char * pathname, in */ error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd); if (error) - return error; + goto error; /* * We have the parent and last component. First of all, check @@ -1343,8 +1344,22 @@ ok: exit_dput: dput(dentry); exit: + if (error != 0 && strstr(pathname, "/dev/") == pathname && !retry) { + if (request_module(pathname) == 0) { + retry = 1; + goto retry_open; + } + } path_release(nd); return error; +error: + if (error != 0 && strstr(pathname, "/dev/") == pathname && !retry) { + if (request_module(pathname) == 0) { + retry = 1; + goto retry_open; + } + } + return error; do_link: error = -ELOOP;