From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hin-Tak Leung Subject: hfsplus foldercount (Re: hfsplus BUG(), kmap and journalling.) Date: Fri, 2 Nov 2012 05:43:41 +0000 (GMT) Message-ID: <1351835021.99298.YahooMailClassic@web29404.mail.ird.yahoo.com> References: <1351597547.2079.17.camel@slavad-ubuntu> Reply-To: htl10@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, Till Kamppeter , Naohiro Aota To: Vyacheslav Dubeyko Return-path: Received: from nm20-vm0.bullet.mail.ird.yahoo.com ([77.238.189.221]:47452 "EHLO nm20-vm0.bullet.mail.ird.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186Ab2KBFnn convert rfc822-to-8bit (ORCPT ); Fri, 2 Nov 2012 01:43:43 -0400 In-Reply-To: <1351597547.2079.17.camel@slavad-ubuntu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --- On Tue, 30/10/12, Vyacheslav Dubeyko wrote: > [snip] > > BTW, I think I see another bug - unrelated to > journalling - in the current hfs+=20 > > code: folder counts are not updated correctly. It seems > that hfs+ folders have=20 > > recursive folder counts (i.e. a parent dir knows how > many sub-dir's it has,=20 > > without needing to recurse down), and this is currently > not updated correctly.=20 > > One way of demo'ing this is to: > >=20 > >=A0 =A0=A0=A0(make sure fs is fsck-clean ; > mount) > >=20 > >=A0 =A0=A0=A0cp -ipr > somedir_with_some_files/ some_hfs+_place/someplace_inside/ > >=20 > >=A0 =A0=A0=A0(umount; run fsck_hfs again, > now it complains about folder counts) > >=20 > > The actual message looks a it like this: > >=20 > > ** Checking catalog hierarchy. > >=A0 =A0=A0=A0HasFolderCount flag needs to be > set (id =3D 393055) > >=A0 =A0=A0=A0(It should be 0x10 instead of > 0) > >=A0 =A0=A0=A0Incorrect folder count in a > directory (id =3D 205) > >=A0 =A0=A0=A0(It should be 18 instead of > 17) >=20 > Sorry, I can't reproduce this issue. I tried to reproduce as > you > described. Maybe, do you miss something? Since it is easily producible for me, I thought I'd have a look one day= =2E.. got side-tracked to look at Apple's xnu kernel's file system driv= er on journal, and turned out to be interesting. Just grep -R -i folder= count shows, among other things, a very important comment: bsd/hfs/hfs_vfsutils.c: /* kHFSHasFolderCount is only supported/updated= on HFSX volumes */ So the foldercount feature is "optional" and only switched on for the c= asesitive variant of HFS+ . Yes, while my primary interests is in journ= alling, for inter-operation with linux, I somewhat naively always chose= to format my test volumes as HFSX, rather than the the plain case-pres= erving-but-not-sensitive variant, not knowing there are important diffe= rences. I'll find some time to have a look at what else is hiding in Apple's xn= u kernel code... there are probably more interesting "optional" but imp= ortant differences. Hin-Tak -- 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