linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC, PATCH 0/6] ext3: do not modify data on-disk when mounting read-only filesystem
@ 2008-03-06  1:59 Duane Griffin
       [not found] ` <a047dfbd7855d5f484ae8a3434f6a073302505be.1204685366.git.duaneg@dghda.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Duane Griffin @ 2008-03-06  1:59 UTC (permalink / raw)
  To: linux-ext4; +Cc: linux-kernel, Theodore Tso, sct, akpm, adilger, Duane Griffin

At present, as discussed in this LKML thread,
http://marc.info/?l=linux-kernel&m=117607695406580, when a dirty ext3
filesystem is mounted read-only it writes to the disk while replaying the
journal log and cleaning up the orphan list. This behaviour may surprise users
and can potentially cause data corruption/loss (e.g. if a system is suspended,
booted into a different OS, then resumed).

This patch series attempts to address this by using a block translation table
instead of replaying the journal on a read-only filesystem.

Patches 1-3 are independent cleanups/bug-fixes for things I came across while
working on this. They could be submitted separately and are not required for
following patches.

Patch 4 is a refactoring change that simplifies the code prior to later
substantive changes.

Patch 5 introduces the translation table and support for a truly read-only
journal into jbd.

Patch 6 uses the facility introduced in patch 5 to add support for true
read-only ext3.

For testing I've been using qemu VMs to create and mount dirtied filesystems. I
have a set of scripts that fully automates creating a dirty filesystem then
checking mounting read-only and read-write produces consistent results. On my
system it can get through around ~30 iteration overnight. If anyone is
interested in the scripts please let me know. Any suggestions for additional
tests or enhancements that could be made to the scripts would be gratefully
received.

TODO:
 * Add R/W remount support
 * Port to ext4

Cheers,
Duane Griffin.

> git diff --stat origin
 fs/ext3/balloc.c        |    2 +-
 fs/ext3/ialloc.c        |    2 +-
 fs/ext3/inode.c         |    8 +-
 fs/ext3/resize.c        |    2 +-
 fs/ext3/super.c         |  123 ++++++++++-----
 fs/ext3/xattr.c         |    8 +-
 fs/jbd/checkpoint.c     |    2 +-
 fs/jbd/commit.c         |    2 +-
 fs/jbd/journal.c        |   68 +++++---
 fs/jbd/recovery.c       |  402 +++++++++++++++++++++++++++++++++--------------
 fs/jbd/revoke.c         |  133 ++++++----------
 fs/ocfs2/journal.c      |    4 +-
 include/linux/ext3_fs.h |    7 +
 include/linux/jbd.h     |   41 +++++-
 14 files changed, 516 insertions(+), 288 deletions(-)


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2008-03-13 12:36 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-06  1:59 [RFC, PATCH 0/6] ext3: do not modify data on-disk when mounting read-only filesystem Duane Griffin
     [not found] ` <a047dfbd7855d5f484ae8a3434f6a073302505be.1204685366.git.duaneg@dghda.com>
2008-03-06  1:59   ` [RFC, PATCH 1/6] jbd: eliminate duplicated code in revocation table init/destroy functions Duane Griffin
     [not found]   ` <bd11bfe0ae59094e7a3fbd813dfd877f989f122f.1204685366.git.duaneg@dghda.com>
2008-03-06  1:59     ` [RFC, PATCH 3/6] jbd: only create debugfs entries if cache initialisation is successful Duane Griffin
     [not found]   ` <f4577a0cc4262de0fbff02cae3858d2e2edfaaea.1204685366.git.duaneg@dghda.com>
2008-03-06  1:59     ` [RFC, PATCH 6/6] ext3: do not write to the disk when mounting a dirty read-only filesystem Duane Griffin
2008-03-06  7:17     ` Andreas Dilger
2008-03-06 11:19       ` Duane Griffin
2008-03-11 15:11       ` Jan Kara
2008-03-12  2:42         ` Duane Griffin
2008-03-12 10:53           ` Jan Kara
     [not found]   ` <7fbb2f28dcb417e3173ffacc103932c36683f2f0.1204685366.git.duaneg@dghda.com>
2008-03-06  1:59     ` [RFC, PATCH 2/6] jbd: replace potentially false assertion with if block Duane Griffin
2008-03-08 14:52     ` Christoph Hellwig
     [not found]   ` <8644b32ddec999bbc1da0ac55ad7b66d0b8176de.1204685366.git.duaneg@dghda.com>
2008-03-06  1:59     ` [RFC, PATCH 4/6] jbd: refactor nested journal log recovery loop into separate functions Duane Griffin
2008-03-08 14:53     ` Christoph Hellwig
2008-03-08 18:40       ` Duane Griffin
2008-03-11 14:35     ` Jan Kara
2008-03-12  1:02       ` Duane Griffin
2008-03-12 10:50         ` Jan Kara
     [not found]   ` <7f095bf2403465433796f2f7aab20f1c9a2e0f73.1204685366.git.duaneg@dghda.com>
2008-03-06  1:59     ` [RFC, PATCH 5/6] jbd: add support for read-only log recovery Duane Griffin
2008-03-11 15:05     ` Jan Kara
2008-03-12  1:40       ` Duane Griffin
2008-03-12 10:51         ` Jan Kara
2008-03-06  3:42 ` [RFC, PATCH 0/6] ext3: do not modify data on-disk when mounting read-only filesystem Andrew Morton
2008-03-06 11:20   ` Duane Griffin
2008-03-13  3:22 ` Daniel Phillips
2008-03-13 12:35   ` Duane Griffin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).