From 1a1c9bb433af252767ee90d6394d287afa30cf8b Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 8 May 2007 00:32:31 -0700 Subject: inode numbering: change libfs sb creation routines to avoid collisions with their root inodes This patch makes it so that simple_fill_super and get_sb_pseudo assign their root inodes to be number 1. It also fixes up a couple of callers of simple_fill_super that were passing in files arrays that had an index at number 1, and adds a warning for any caller that sends in such an array. It would have been nice to have made it so that it wasn't possible to make such a collision, but some callers need to be able to control what inode number their entries get, so I think this is the best that can be done. Signed-off-by: Jeff Layton Cc: Christoph Hellwig Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/binfmt_misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/binfmt_misc.c') diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index e6f57990b12..18657f001b4 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -727,8 +727,8 @@ static const struct super_operations s_ops = { static int bm_fill_super(struct super_block * sb, void * data, int silent) { static struct tree_descr bm_files[] = { - [1] = {"status", &bm_status_operations, S_IWUSR|S_IRUGO}, - [2] = {"register", &bm_register_operations, S_IWUSR}, + [2] = {"status", &bm_status_operations, S_IWUSR|S_IRUGO}, + [3] = {"register", &bm_register_operations, S_IWUSR}, /* last one */ {""} }; int err = simple_fill_super(sb, 0x42494e4d, bm_files); -- cgit v1.2.3