From: Jeff Layton Subject: [PATCH 3/3] new_inode_autonum: fix up possible i_ino collision in simple_fill_super() Date: Thu, 09 Nov 2006 10:24:46 -0500 Message-ID: <1163085886.21469.47.camel@dantu.rdu.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mx1.redhat.com ([66.187.233.31]:6871 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S1424047AbWKIPYz (ORCPT ); Thu, 9 Nov 2006 10:24:55 -0500 To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@osdl.org Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 mann= er. =20 Signed-off-by: J=C3=B6rn Engel Signed-off-by: Jeff Layton 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 =3D 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 =3D 0x8000000; inode->i_mode =3D S_IFDIR | 0755; inode->i_uid =3D inode->i_gid =3D 0; inode->i_blocks =3D 0; - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html