Messages in this thread | | | Date | Thu, 28 Aug 2008 13:21:24 -0700 | From | "H. Peter Anvin" <> | Subject | Re: [PATCH 5/7] FUSE: implement ioctl support |
| |
Miklos Szeredi wrote: > On Thu, 28 Aug 2008, H. Peter Anvin wrote: >> Tejun Heo wrote: >>> Ah.... funky. If this retry thing is too repulsive, I guess the best >>> alternative would be directly accessing caller's memory as Miklos suggested. >>> >> Be careful -- there are some serious dragons there in the presence of >> multiple threads. > > OK, it should map /proc/pid/task/tid/mem. Or rather > /proc/tid/task/tid/mem, as the pid (tgid) of the caller is not > currently passed to the filesystem. >
Uhm, no. You can still have it change underneath you as long as you have any thread of execution with access to the same memory.
This is *hard* to get right, and we screw this up in the kernel with painful regularity. The throught of having user-space processes, which don't have access to the kernel locking primitives and functions like copy_from_user() dealing with this stuff scares me crazy.
That is why I'm suggesting using an in-kernel linearizer.
-hpa
| |