lkml.org 
[lkml]   [2007]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch v2] epoll use a single inode ...
Hi!

> > > @@ -763,15 +767,17 @@
> > > * using the inode number.
> > > */
> > > error = -ENOMEM;
> > > - sprintf(name, "[%lu]", inode->i_ino);
> > > this.name = name;
> > > - this.len = strlen(name);
> > > - this.hash = inode->i_ino;
> > > + this.len = sprintf(name, "[%p]", ep);
> > > + this.hash = 0;
> >
> > Please don't expose kernel pointers to user space.
> >
> > It's much better to do something like
> >
> > static unsigned int epoll_inode;
> >
> > this.len = sprintf(name, "[%u]", ++epoll_inode);
> >
> > if you just need some pseudo-unique name to distinguish two epoll things
> > from each other (vs from a dup'ed fd).
>
> Heh, this is what Al was saying ;)
> I'm fine with that, but how about counter cycles (going back to zero)?

Just use u64?
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-10 09:19    [W:0.100 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site