Re: Loop Devices over NFS don't work?

Jason Gunthorpe (jgg@ualberta.ca)
Mon, 5 Jul 1999 16:06:44 -0600 (MDT)


On Mon, 5 Jul 1999, Alan Cox wrote:

> > Oh, in that case shouldn't losetup fail with an error?
> >
> > Also, is it really necessary to have bmap to do loop devices? Couldn't
> > some sort of alternate mechanism be used?
>
> You could fall back to read/write in theory. There is an interesting project
> for you 8)

Hrm, I have tried a few things, and I am having poor luck making read work
in kernel space. I am using a call like this:

lo->lo_dentry->d_inode->i_op->
default_file_ops->read(lo->lo_backing_file,dest_addr,len,
&lo->lo_backing_file->f_pos));

Which I belive goes over to mm/filemap.c:generic_file_read which then
seems to return efault because access_ok says that it cannot write to
dest_addr (which should be within a buffer head, I think)

I'm going to guess here and say that access_ok is intended to restrict
user-space access, so it is probably ment to fail for memory belonging to
the kernel (?) I guess the only fix is to create another function in
filemap.c that has that call removed?

Is this correct or have I missed something?

Otherwise for my simple needs, removing the access_ok check works 'well
enough'

Jason

-
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/