* [PATCH 3/3] new_inode_autonum: fix up possible i_ino collision in simple_fill_super()
@ 2006-11-09 15:24 Jeff Layton
0 siblings, 0 replies; only message in thread
From: Jeff Layton @ 2006-11-09 15:24 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel, akpm
simple_fill_super() looked like a bug waiting to happen. It is fairly hard to
trigger, but still. This should fix it, although in a fairly crude manner.
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
diff --git a/fs/libfs.c b/fs/libfs.c
index bd08e0e..477c012 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -373,6 +373,10 @@ int simple_fill_super(struct super_block
inode = new_inode(s);
if (!inode)
return -ENOMEM;
+ /* ino must not collide with any ino assigned in the loop below.
+ * This value is arbitrary but should be "big enough" to avoid
+ * collisions. */
+ inode->i_ino = 0x8000000;
inode->i_mode = S_IFDIR | 0755;
inode->i_uid = inode->i_gid = 0;
inode->i_blocks = 0;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-11-09 15:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-09 15:24 [PATCH 3/3] new_inode_autonum: fix up possible i_ino collision in simple_fill_super() Jeff Layton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®