From: Zach Brown Subject: Re: [PATCH 1/2] ext4: fix readdir error in case inline_data+dir_index. Date: Fri, 12 Apr 2013 14:55:27 -0700 Message-ID: <20130412215527.GA29807@lenny.home.zabbo.net> References: <1365608030-3806-1-git-send-email-tm@tao.ma> <1365608228-3950-1-git-send-email-tm@tao.ma> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-ext4@vger.kernel.org To: Tao Ma Return-path: Received: from mx1.redhat.com ([209.132.183.28]:32203 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752784Ab3DLVza (ORCPT ); Fri, 12 Apr 2013 17:55:30 -0400 Content-Disposition: inline In-Reply-To: <1365608228-3950-1-git-send-email-tm@tao.ma> Sender: linux-ext4-owner@vger.kernel.org List-ID: On Wed, Apr 10, 2013 at 11:37:07PM +0800, Tao Ma wrote: > From: Tao Ma > > Zach reported a problem that if inline data is enabled, we don't > tell the difference between the offset of '.' and '..'. And a > getdents will fail if the user only want to get '.' and what's worse, > if there is a conversion happens when the user calls getdents > many times, he/she may get the same entry twice. > > In theroy, a dir block would also fail if it is converted to a > hashed-index based dir since f_pos will become a hash value, not the > real one, but it doesn't happen. And a deep investigation > shows that we uses a hash based solution even for a normal dir if > the dir_index feature is enabled. > > So this patch just adds a new htree_inlinedir_to_tree for inline dir, > and if we find that the hash index is supported, we will do like what > we do for a dir block. Mmm, I like the sound of that fix. Nice and simple. The little test app that was seeing duplicate entries now sees stable f_pos values and no dupes after the patch. So I think this works. Thanks for fixing this. - z