Comment 6 for bug 41624

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 41624] Re: [Bug 41624] Re: aggressive volume discovery => data loss

On Tue, May 02, 2006 at 11:09:12AM -0000, Ian Jackson wrote:
> Is NTFS journalling and does Linux replay the journal when
> mounting it ? I thought the Linux NTFS support was entirely
> read-only, which is quite safe.

NTFS is journalled, yes. I've checked the kernel code and it indeed
doesn't seem to replay the journal when mounting read-only.

As Matthew says, ext3 replays the journal even when mounting read-only:

        if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER)) {
                if (sb->s_flags & MS_RDONLY) {
                        printk(KERN_INFO "EXT3-fs: INFO: recovery "
                                        "required on readonly filesystem.\n");
                        if (really_read_only) {
                                printk(KERN_ERR "EXT3-fs: write access "
                                        "unavailable, cannot proceed.\n");
                                return -EROFS;
                        }
                        printk (KERN_INFO "EXT3-fs: write access will "
                                        "be enabled during recovery.\n");
                }
        }

Having looked through other bits of kernel code, ReiserFS and XFS do the
same (although XFS has a norecovery mount option to suppress replay);
all of these three filesystems explicitly avoid replaying the journal if
the underlying block device is read-only. I can't find the log replay
code for JFS.