lkml.org 
[lkml]   [1998]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH: smart symlink loop detection.
Hi!

> There's just one problem: I need to call inode->i_op->readlink() to
> get the "value" of a symlink. ext2_readlink (among others I suspect)
> uses copy_to_user(), which _sometimes_ returns -EFAULT when trying to
> write the symlink's text to the buffers I'm using. (This happens w/
> all sorts of buffers: static char[]'s in the fn, kmalloc(PATH_MAX+1,
> GFP_{KERNEL,USER}), and get_free_page(GFP_{KERNEL,USER}).) My guess
> is it doesn't like writing to kernel-space buffers. BSD handles this
> using a flag in their "uio" structure. I'm sure this can be done in
> Linux, there's just something obvious I'm missing.

You need to do set_fs(get_ds()) somewhere, to let kernel know it
should really write there. Take a look at drivers/block/nbd.c - I'm
doing it there.

Pavel

--
The best software in life is free (not shareware)! Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.057 / U:1.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site