linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Chris Mason <chris.mason@oracle.com>
Cc: "Jörn Engel" <joern@logfs.org>, "Theodore Tso" <tytso@mit.edu>,
	"Andreas Dilger" <adilger@sun.com>,
	"Christoph Hellwig" <hch@infradead.org>,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	akpm@linuxfoundation.org, "Mark Fasheh" <mfasheh@suse.com>,
	mtk.manpages@gmail.com
Subject: Re: [PATCH 1/4] vfs: vfs-level fiemap interface
Date: Fri, 19 Sep 2008 18:38:02 +0100	[thread overview]
Message-ID: <20080919173802.GB17666@shareable.org> (raw)
In-Reply-To: <20080919140502.GA6985@think.oraclecorp.com>

Chris Mason wrote:
> On Wed, Sep 17, 2008 at 04:02:12PM +0100, Jamie Lokier wrote:
> > Jörn Engel wrote:
> > > Apart from the typo above, here is a more discouraging version:
> > > 
> > >   In general, accessing the block device directly is strongly discouraged.
> > >   Exceptions exist mainly in the form of boot loaders like lilo and grub,
> > >   at a time when the filesystem is not (cannot be) mounted.
> > > 
> > >   If the flag DATA_ENCODED is set, however, even this exception is no
> > >   longer valid.  The content is encoded in some form.  Details are
> > >   unknown, it could be compressed, encrypted or something else.
> > 
> > I'm not clear about something from the above description.
> > 
> > If I were writing a journalling / tree-like filesystem, and I did
> > store data in blocks without encoding, but fsync() only waits for them
> > to be committed to journal, not their final destination, and also they
> > might be moved around - should I set DATA_ENCODED or not?  (And should
> > I return the temporary location in the long-running journal since
> > that's the only place the data is committed at the time of the call?)
> > 
> > Assume that even reading after unmounting is not 100% safe, because
> > the data blocks could be relocated after calling FIEMAP (when the
> > filesystem must be mounted), and before the unmount.
> 
> For the journal case at least, grub can walk through the log of the FS
> looking for up to date copies of things.  It does this already for
> reiserfs because the btree can't be trusted at all without a log replay.

Ok, that's good - grub doesn't need FIEMAP, it reads the filesystem properly.

So if I were writing a filesystem, what am I expected to return in
FIEMAP for these cases?  I'm thinking I should set DATA_ENCODED, even
though the examples in Jörn's description don't cover this.

I'm thinking there are three main uses for FIEMAP:

  1. LILO and similar.  LILO itself is fine with FIBMAP though.

  2. Fragmentation measurement and possibly defragmentation tools.

  3. Something wants to have an idea of which areas of disk will be
     accessed, so it can optimise I/O at a higher level - i.e. a database.
     This isn't foolproof, especially for writes on recent filesystems
     which don't overwrite in place.

1 means DATA_ENCODED should be set whenever there's any likelihood
that the result isn't reliable, so that would include when data is
stored in a journal or other temporary place and not a permanent place
on disk.

2 and 3 don't care about DATA_ENCODED at all.

-- Jamie
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-09-19 17:38 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-13 18:47 YET ANOTHER resend of the fiemap patches Theodore Ts'o
2008-09-13 18:49 ` [PATCH 1/4] vfs: vfs-level fiemap interface Theodore Ts'o
2008-09-13 18:49   ` [PATCH 2/4] ocfs2: fiemap support Theodore Ts'o
2008-09-13 18:49     ` [PATCH 3/4] generic block based fiemap implementation Theodore Ts'o
2008-09-13 18:49       ` [PATCH 4/4] Hook ext4 to the vfs fiemap interface Theodore Ts'o
2008-09-13 21:17   ` [PATCH 1/4] vfs: vfs-level " Anton Altaparmakov
2008-09-13 21:29     ` Theodore Tso
2008-09-13 21:45       ` Matthew Wilcox
2008-09-13 22:41         ` Theodore Tso
2008-09-13 21:59       ` Anton Altaparmakov
2008-09-14 13:51         ` Christoph Hellwig
2008-09-14 13:48       ` Christoph Hellwig
2008-09-14 17:58         ` Theodore Tso
2008-09-15 14:49           ` Christoph Hellwig
2008-09-15 17:53             ` Mark Fasheh
2008-09-16  6:51               ` Andreas Dilger
2008-09-16 21:31               ` Theodore Tso
2008-09-20 16:47                 ` Josef 'Jeff' Sipek
2008-09-29  1:07                   ` Theodore Tso
2008-09-29 21:13                     ` Mark Fasheh
2008-09-29 22:10                       ` Theodore Tso
2008-09-14 13:47   ` Christoph Hellwig
2008-09-14 18:01     ` Theodore Tso
2008-09-14 18:08       ` Christoph Hellwig
2008-09-14 19:58         ` Theodore Tso
2008-09-15 14:47           ` Christoph Hellwig
2008-09-16  6:49             ` Andreas Dilger
2008-09-16 22:03               ` Theodore Tso
2008-09-17 14:18                 ` Jörn Engel
2008-09-17 15:02                   ` Jamie Lokier
2008-09-17 15:25                     ` Theodore Tso
2008-09-19 14:05                     ` Chris Mason
2008-09-19 17:38                       ` Jamie Lokier [this message]
2008-09-20  7:43                         ` Dave Chinner
2008-09-20 13:50                           ` Chris Mason
     [not found]                           ` <20080920135048.GA15698@think.oraclecorp.com>
2008-09-20 15:36                             ` Jamie Lokier
2008-09-20 15:44                               ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2008-10-09  1:48 PATCH [0/4] Updated**3 fiemap patches Theodore Ts'o
     [not found] ` <1223516913-17612-1-git-send-email-tytso-3s7WtUTddSA@public.gmane.org>
2008-10-09  1:48   ` [PATCH 1/4] vfs: vfs-level fiemap interface Theodore Ts'o
2008-10-07  1:06 PATCH [0/4] Updated**2 fiemap patches Theodore Ts'o
2008-10-07  1:06 ` [PATCH 1/4] vfs: vfs-level fiemap interface Theodore Ts'o
     [not found]   ` <1223341581-13802-2-git-send-email-tytso-3s7WtUTddSA@public.gmane.org>
2008-10-07  1:09     ` Theodore Tso
2008-10-03 21:59 [PATCH 0/4] Updated fiemap patches Theodore Ts'o
2008-10-03 21:59 ` [PATCH 1/4] vfs: vfs-level fiemap interface Theodore Ts'o
2008-10-04  2:12   ` Theodore Tso
2008-10-06 18:15     ` jim owens
2008-10-06 21:07       ` Theodore Tso
2008-10-07 10:12         ` Christoph Hellwig
2008-10-07 10:56           ` Andreas Dilger
2008-10-07 12:52             ` Theodore Tso
2008-10-07 13:00           ` Jamie Lokier
2008-10-07 13:02             ` Christoph Hellwig
2008-10-07 13:24               ` Jamie Lokier
2008-10-07 13:28                 ` Christoph Hellwig
2008-10-07 15:45                   ` Theodore Tso
2008-10-07 16:01                     ` jim owens
     [not found]                       ` <48EB87DE.4090607-VXdhtT5mjnY@public.gmane.org>
2008-10-07 18:52                         ` Theodore Tso
     [not found]                           ` <20081007185219.GD15929-3s7WtUTddSA@public.gmane.org>
2008-10-07 20:31                             ` Christoph Hellwig
2008-10-07 13:48             ` Theodore Tso
2008-10-07 23:43               ` Jamie Lokier
2008-10-09 20:40                 ` Andreas Dilger
2008-10-06 13:07   ` steve
2008-06-25 22:18 Mark Fasheh

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=20080919173802.GB17666@shareable.org \
    --to=jamie@shareable.org \
    --cc=adilger@sun.com \
    --cc=akpm@linuxfoundation.org \
    --cc=chris.mason@oracle.com \
    --cc=hch@infradead.org \
    --cc=joern@logfs.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --cc=mtk.manpages@gmail.com \
    --cc=tytso@mit.edu \
    /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).