From: Hin-Tak Leung Subject: what fsck does to the hfs+ journal Date: Sat, 5 Apr 2014 01:25:09 +0100 (BST) Message-ID: <1396657509.5423.YahooMailBasic@web172305.mail.ir2.yahoo.com> Reply-To: htl10@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Cc: viro@zeniv.linux.org.uk, hch@infradead.org, saproj@gmail.com To: slava@dubeyko.com, linux-fsdevel@vger.kernel.org Return-path: Received: from nm40.bullet.mail.ne1.yahoo.com ([98.138.229.33]:47850 "EHLO nm40.bullet.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbaDEAev convert rfc822-to-8bit (ORCPT ); Fri, 4 Apr 2014 20:34:51 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, I have somewhat looked at what fsck does to unclean journals, and the outcome is surprising. I have another darwin virtual machine which I killed for some other reason while doing some heavy writing. - xnu replays an unclean journal with "replay_journal: from x to y (joffset 0xZZZZZZZ)" - running fsck on its disk image, always results in xnu outputing "journal start/end pointer reset". This behavior is cleared only after the first rw mount. You can keep seeing the same message if you keep booting single user mode (i.e. read-only mount). On first read-write mount, I get "Remove x orphaned /unlinked files and y directories", under either case. There is a JOURNAL_RESET flag in the xnu code, which results in the pointer reset message, but diskdev_cmds does not even have this define. (it does have JOURNAL_NO_GROUP_COMMIT, however), so I don't know how it was set (yet). xnu/bsd/vfs/vfs_journal.h-293-/* xnu/bsd/vfs/vfs_journal.h-294- * flags for journal_create/open. only can use xnu/bsd/vfs/vfs_journal.h-295- * the low 16 bits for flags because internal xnu/bsd/vfs/vfs_journal.h-296- * bits go in the high 16. xnu/bsd/vfs/vfs_journal.h-297- */ xnu/bsd/vfs/vfs_journal.h-298-#define JOURNAL_NO_GROUP_COMMIT 0x00000001 xnu/bsd/vfs/vfs_journal.h:299:#define JOURNAL_RESET 0x00000002 journal replay results in a bigger amount of file system change, than just fsck + mount rw. (in fact in the latter case, it seems there is a lot of fs changes on the first rw mount after). Do we remove orphaned/unlinked files directories on read-write mount of hfs+ in the linux kernel? Hin-Tak