Skip to contentSkip to conversation

Use 2 as fallback inode number on 32 Bit kernel

PATCH Amon Ott 1 participant 1 message Jan 23, 2012 Ceph client

lore
Share & tools
lore

Amon Ott

author
#0 lore raw

Hi folks,

the current code in 32 Bit use 1 as fallback number, if the inode number calculation returns 0. This always collides with the inode number of the root inode. The attached patch changes the fallback number to 2, which seems to be unused on our test systems.

Amon Ott

Signature · 12 lines
Dr. Amon Ott
m-privacy GmbH           Tel: +49 30 24342334
Am Köllnischen Park 1    Fax: +49 30 24342336
10179 Berlin             http://www.m-privacy.de

Amtsgericht Charlottenburg, HRB 84946

Geschäftsführer:
 Dipl.-Kfm. Holger Maczkowsky,
 Roman Maczkowsky

GnuPG-Key-ID: 0x2DD3A649

commit e9b257a3b1364980f3247e110c4ded56b4fbe54a

Author: Amon Ott <[email protected]>
Date:   Fri Jan 20 15:40:51 2012 +0100

Use 2 instead of 1 as fallback for 32 Bit inode number.

The root directory of the Ceph mount has inode number 1, so falling back to 1 always creates a collision. 2 is unused on my test systems and seems less likely to collide.

fs/ceph/super.h +1 -1
index 9d19790..595f026 100644
@@ -351,7 +351,7 @@ static inline u32 ceph_ino_to_ino32(__u64 vino)
 	u32 ino = vino & 0xffffffff;
 	ino ^= vino >> 32;
 	if (!ino)
-		ino = 1;
+		ino = 2;
 	return ino;
 }