linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Marc Lehmann <schmorp@schmorp.de>
Cc: David Gnedt <david.gnedt@davizone.at>,
	Matthias Prager <linux@matthiasprager.de>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: f2fs bug: Unable to mount big volumes in kernel 4.5
Date: Wed, 23 Mar 2016 18:29:23 -0700	[thread overview]
Message-ID: <20160324012923.GA24644@jaegeuk.gateway> (raw)
In-Reply-To: <20160323205204.GB4443@schmorp.de>

On Wed, Mar 23, 2016 at 10:00:10PM +0100, Marc Lehmann wrote:
> On Wed, Mar 23, 2016 at 05:41:57PM +0100, Matthias Prager <linux@matthiasprager.de> wrote:
> > detail. Writing on a read-only fs is a no go! There usually is a reason
> > why someone mounts an filesystem read-only and f2fs should not simply
> > ignore such a flag.
> 
> Hmm, no.
> 
> Even an unusual case is enough, such as mounting it read-only for data
> recovery because the underlying device dies on writes (quite likely for
> ssds, the primary target for f2fs).
> 
> However, other linux filesystems either replay their journal on readonly
> mounts, or even *require* a replay (most have a flag to prevent that,
> but that might not help data recovery). In fact, my example above can
> relatively easily worked around using device mapper and a temporary
> snapshot volume for writes.
> 
> So, the "ro" mount flag in linux does not mean "do not write to the
> backing store", and did not have that meaning for a long time, so it's
> fine for f2fs to write even for ro mounts.
> 
> That means the correct behaviour for f2fs is to write unless "norecovery"
> has been specified, which already exists for this purpose on f2fs.

Well. IMO, we have to deal with fixing inconsistency and doing recovery
separately.

In terms of recovery, I agree that we must do it no matter how fs is mounted.
The only missing part in f2fs is that, we need to throw an error, if there is
something to recover under read-write and norecovery mount likewise ext4.

Regarding to fixing inconsistency dynamically, it seems depending on filesystems
according to how severely it can corrupt the underlying on-disk layout.
For example, I could see that btrfs conducts btrfs_recover_relocation only
when read-write mount, while doing btrfs_replay_log all the time.

Back to our cases, I think fixing superblock just depends on our policy.
Initially, I added f2fs_commit_super to recover the broken superblock
optionally, since we have no problem to mount with the alternate valid
superblock.

In the case of misaligned end address, it also doesn't need to fix it at
read-only mount, since it has nothing to do with read operations.
That is only used to check the boundary bug when writing blocks.

Lastly, when considerting RO to RW case as you pointed out, I think we need to
handle that in f2fs_remount by adding a superblock flag likewise ext4.

Let me submit some patches for them.

Thanks,

> Different behaviour would put f2fs at odds with other existing
> filesystems, which write on "ro" mounts to gain integrity.
> 
> Even better would be if there was a "force" or similar option which would
> allow me to mount filesystems with possibly bad superblock data. This
> could even be rolled into the existing "norecovery" switch, which, when
> given, could try to mount even if the superblock has (some amount of) bad
> data.
> 
> -- 
>                 The choice of a       Deliantra, the free code+content MORPG
>       -----==-     _GNU_              http://www.deliantra.net
>       ----==-- _       generation
>       ---==---(_)__  __ ____  __      Marc Lehmann
>       --==---/ / _ \/ // /\ \/ /      schmorp@schmorp.de
>       -=====/_/_//_/\_,_/ /_/\_\

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

  reply	other threads:[~2016-03-24  1:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <56EEC766.2030503@davizone.at>
     [not found] ` <20160320224654.GB4752@jaegeuk.hsd1.ca.comcast.net>
2016-03-21  3:18   ` f2fs bug: Unable to mount big volumes in kernel 4.5 Chao Yu
2016-03-21  9:58     ` Matthias Prager
2016-03-21 15:57       ` Jaegeuk Kim
2016-03-21 10:30     ` Marc Lehmann
2016-03-21 16:03       ` Jaegeuk Kim
2016-03-22  3:37         ` Chao Yu
2016-03-22 20:05           ` Jaegeuk Kim
2016-03-21 20:58     ` David Gnedt
2016-03-21 22:56       ` Matthias Prager
2016-03-22  8:16         ` Chao Yu
     [not found]         ` <20160322203613.GA14498@jaegeuk.gateway>
2016-03-22 20:50           ` Matthias Prager
2016-03-22 21:05             ` Jaegeuk Kim
     [not found]           ` <56F29214.9040001@davizone.at>
2016-03-23 16:41             ` Matthias Prager
2016-03-23 21:00               ` Marc Lehmann
2016-03-24  1:29                 ` Jaegeuk Kim [this message]
2016-03-22 21:05         ` Jaegeuk Kim
2016-03-22  8:15       ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160324012923.GA24644@jaegeuk.gateway \
    --to=jaegeuk@kernel.org \
    --cc=david.gnedt@davizone.at \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux@matthiasprager.de \
    --cc=schmorp@schmorp.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).