From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hin-Tak Leung Subject: Re: [PATCH v3 01/15] hfsplus: add necessary declarations for journal replay Date: Sat, 15 Feb 2014 04:04:26 +0000 (GMT) Message-ID: <1392437066.60668.YahooMailBasic@web172306.mail.ir2.yahoo.com> References: <1392362538.9253.13.camel@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: Sergei Antonov , Linux FS devel list , Al Viro , ChristophHellwig , Andrew Morton To: Vyacheslav Dubeyko Return-path: Received: from nm37.bullet.mail.ne1.yahoo.com ([98.138.229.30]:40010 "EHLO nm37.bullet.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751606AbaBOEHW convert rfc822-to-8bit (ORCPT ); Fri, 14 Feb 2014 23:07:22 -0500 In-Reply-To: <1392362538.9253.13.camel@ubuntu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: -------------------------------------------- On Fri, 14/2/14, Vyacheslav Dubeyko wrote: Subject: Re: [PATCH v3 01/15] hfsplus: add necessary declarations for = journal replay To: htl10@users.sourceforge.net Cc: "Sergei Antonov" , "Linux FS devel list" , "Al Viro" , "Christo= phHellwig" , "Andrew Morton" Date: Friday, 14 February, 2014, 7:22 =20 On Thu, 2014-02-13 at 20:07 +0000, Hin-Tak Leung wrote: >=A0=20 >=A0 Hi all, >=20 > I Have mentioned earlier that I have the powerpc version of Darwin 8 (equivalent > to Mac OS X 10.4) running inside pearpc, and have other uses of it and therefore have given it > some use. I can look into this - and probably will, when I try v3 of=A0 Vyacheslav's patch set. >=20 =20 So, had you any error messages when you tried patchset v3? If you really have HFS+ volume with big-endian structures in journal then failure with journal replay or volume corruption is inevitable. =20 > Darwin 8 does certainly noticed it was uncleanly shut down and display a message about > journal replay the next time it starts; also it seems to notice the journal had been played > with by somebody else - there is a message about invalid/invalidating journal entries > when I ran fsck.hfsplus manually between unclean shut down and restart. > (That's assuming=A0 fsck.hfsplus can cope with disk images written by the powerpc > version of darwin 8 correctly, one way or another - I should hope so, as it is > not unthinkable for a mac user to own both kind of macs). >=20 > So it appears that the journal is not emptied by fsck.hfsplus, but simply marked done > and no longer relevant, and the darwin kernel code notices that. >=20 =20 As far as I can judge, fsck tool doesn't replay journal, usually. It need to take into account presence of journal with transactions. But namely file system driver is responsible for journal replay. And, as I remember correctly, fsck.hfsplus claims about presence of journal and it suggests to use force option for volume checking in such case. =20 Thanks, Vyacheslav Dubeyko. =20 Hi Vyacheslav, I am afraid I have bad news for you - Sergei may be right. This is what shows on an unclean-shutdown image: [179982.068363] hfsplus: invalid journal header [179982.068375] hfsplus: journal replay failed, mounting read-only [179982.068378] hfsplus: filesystem was not cleanly unmounted, mounting= read-only [179982.068380] hfsplus: running fsck.hfsplus is recommended This is on the clean shutdown after: [182188.224271] hfsplus: invalid journal header [182188.224287] hfsplus: journal replay failed, mounting read-only Obviously my virtual machine is still working, so the file system must be valid. I have also recorded that the darwin kernel outputs this when replaying= the journal: Feb 14 19:15:55 localhost kernel[0]: jnl: replay_journal: from: 336537= 6 to: 2762752 (joffset 0x1a000) which might be interesting to try to replicate. The good news is I have saved the unclean image, and the clean one afte= r, they compress to just over 600MB each (and expands to 3GB each). Since they are just darwin 8 (plus some open-source software I tried to= work on within) and *not* full Mac OS X, I suppose you can have them, if you can find the space for me to upload them to. As I mentioned earlier that the darwin kernel seems to notice that its = filesystem had been manipulated by fsck.hfsplus. To be precise, it seems that whenever I had done a fsck.hfsplus between, the darwin kernel outp= uts this kind of message: =46eb 12 07:23:20 localhost kernel[0]: jnl: journal start/end pointers = reset! (jnl 0x1838e60; s 0x232a00 e 0x722600) =46eb 12 15:22:37 localhost kernel[0]: jnl: journal start/end pointers = reset! (jnl 0x17dbe60; s 0x96600 e 0x322600) So it might be also worth looking at the XNU source what that means, and whether fsck.hfsplus is behaving correctly on x86_64 linux on manip= ulating powerpc HFS+ images. OTOH, I am happy if you have debug patches, etc to try thing out at thi= s end. 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