Re: NULL task->files problem?

Bill Hawes (whawes@star.net)
Sat, 04 Oct 1997 14:58:29 -0400


David S. Miller wrote:
> What you could do for the moment is the following. Fork the kernel
> thread with the CLONE_FILES flag set, in copy_files() change the first
> couple lines to go:
>
> oldf = current->files;
> if(clone_flags & CLONE_FILES) {
> if(oldf)
> oldf->count++;
> return 0;
> }

The process in question is rpciod, which sometimes gets launched from a
user process (mount calling nfs_read_super), but conceivably is launched
from lockd. In the former case we wouldn't want to do a CLONE_FILES, I
think.

My current fix is just to test in do_fork() for null oldf:
if (!oldf)
return 0;

Also, a simpler fix for the lockd/sunrps patch I posted is to move the

exit_files(current);

line in fs/lockd/svc.c to _follow_ the rpciod_up() call. I've tested
both ways and they work OK.

I've also made rpciod_up() return an indication of success, so that the
mount won't proceed if for some reason there's no rpciod process.

Regards,
Bill