From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Layton Subject: Re: [PATCH] make last_inode counter in new_inode 32-bit on kernels that offer x86 compatability Date: Tue, 07 Nov 2006 17:09:57 -0500 Message-ID: <1162937397.3689.5.camel@tleilax.poochiereds.net> References: <454FA032.1070008@redhat.com> <20061106211134.GB691@wohnheim.fh-wedel.de> <454FAAF8.8080707@redhat.com> <1162914966.28425.24.camel@dantu.rdu.redhat.com> <20061107172835.GB15629@wohnheim.fh-wedel.de> <20061107174217.GA29746@wohnheim.fh-wedel.de> <20061107175601.GB29746@wohnheim.fh-wedel.de> <1162928464.28425.59.camel@dantu.rdu.redhat.com> <20061107204135.GF29746@wohnheim.fh-wedel.de> <1162933980.28425.64.camel@dantu.rdu.redhat.com> <20061107212012.GC27140@parisc-linux.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: J?rn Engel , Eric Sandeen , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Return-path: To: Matthew Wilcox In-Reply-To: <20061107212012.GC27140@parisc-linux.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 2006-11-07 at 14:20 -0700, Matthew Wilcox wrote: > On Tue, Nov 07, 2006 at 04:13:00PM -0500, Jeff Layton wrote: > > + /* ino must not collide with any ino assigned in the loop below. Set > > + it to the highest possible inode number */ > > + inode->i_ino = (1 << (sizeof(s->s_lastino) * 8)) - 1; > > This really isn't a good idiom to be using; GCC now takes this to mean > "I can reformat your hard drive because you did something outside the > spec". > > Try instead: > + inode->i_ino = -1; > The problem there is that on platforms with a 64-bit ino_t, this will be too large to fit in a 32-bit field and we'll end up with the same EOVERFLOW problem. Is there a more correct way to make it size appropriately given the different possible sizes of s_lastino? I suppose we could just set it to 0xffffffff and hope that that is "big enough" for most cases. -- Jeff