On Fri, Oct 11, 2013 at 03:35:46PM +0600, Roman Mamedov wrote:
> On Fri, 11 Oct 2013 11:23:04 +0200
> Stefan Behrens <sbehr...@giantdisaster.de> wrote:
> 
> > On Fri, 11 Oct 2013 09:13:24 +0800, Wang Shilong wrote:
> > > On 10/11/2013 01:40 AM, Ilya Dryomov wrote:
> > > 
> > > I have a question in my mind.
> > > 
> > > Can we reach a state that there is operation in progress when filesystem
> > > has been readonly?If we do cancel operations on a ro filesystem, we should
> > > get "No operations in progress" .
> > 
> > Well, it's arguable what ro means. No write to the devices at all?
> 
> If I had an FS image and mounted it as -o loop,ro I'd simply expect md5sum of
> that image to match before mount and after unmount, i.e. no writes at all.
> Really, how can one argue with what "read only" means? If it will mean
> something else than a complete absence of writes, then how can we mount
> devices or FS images to do forensics, etc? Or do a recovery from a difficult
> corruption or try to debug an FS crash.

   I think the issue here is that with ext3,4 the FS data structures
can be in an inconsistent (i.e. broken) state unless you do the
journal replay, so you're left with the choice of "replay the journal
and have a working filesystem that you can't write to", or "don't
modify anything, and have a useless filesystem with errors you could
fix with the information in the journal".

   Fortunately, we don't (well, shouldn't) have that issue in btrfs --
if we don't replay the log, we've still got a consistent FS, so it's
much easier conceptually to mount an FS read-only (with the proviso
that a RO mount may be missing some data that was saved earlier, but
you'll get that back if you allow the log reply with a rw mount
later).

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
     --- Gentlemen!  You can't fight here! This is the War Room! ---     

Attachment: signature.asc
Description: Digital signature

Reply via email to