[lkml]   [2006]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] make last_inode counter in new_inode 32-bit on kernels that offer x86 compatability
On Mon, 6 November 2006 14:50:58 -0600, Eric Sandeen wrote:
> >
> > While you're at it, how about making last_ino per-sb instead of
> > system-wide? ino collisions after a wrap are just as bad as inos
> > beyond 32bit. And this should be a fairly simple method to reduce the
> > risk.
> Using a global counter for multiple filesystems should actually -reduce-
> the chance of a collision on the same filesystem, since after you wrap the
> recycled number may go to a different filesystem.

You're missing something. The chance for a collision _per wrap_ is
reduced, as you said. But the number of wraps goes up. Overall and
for large numbers, the two effects compensate each other.

For not-so-large numbers, you can get by without the wrap by having
this per-sb. And if you have just one or two wrapping filesystems, at
least the others are protected. It's not much, but it is a simple
thing to do.

> To fix this properly, we'd need some sort of checking that the inode number
> isn't currently being used on the filesystem in question before it's
> assigned to the new inode.

Absolutely. Thinking about it, iget() already has a lot of what is
needed - except that it can block and has side effects we don't really
want. Sounds more complicated, but I would love to be proven wrong
here. :)


Joern's library part 7:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-11-06 22:15    [W:0.086 / U:0.800 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site