linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Andreas Dilger <adilger@sun.com>
Cc: Mark Fasheh <mfasheh@suse.com>,
	linux-fsdevel@vger.kernel.org, Andreas Dilger <adilger@shaw.ca>,
	Kalpak Shah <Kalpak.Shah@sun.com>,
	Eric Sandeen <sandeen@redhat.com>,
	Josef Bacik <jbacik@redhat.com>
Subject: Re: [PATCH 0/4] Fiemap, an extent mapping ioctl - round 2
Date: Thu, 26 Jun 2008 13:19:51 +0100	[thread overview]
Message-ID: <20080626121950.GB32417@shareable.org> (raw)
In-Reply-To: <20080626102403.GN6239@webber.adilger.int>

Andreas Dilger wrote:
> > Is there a reason why fsync() before calling FIEMAP is unsuitable?
> 
> This was added because the xfsbmap operation always did an fsync before
> returning the extents.  I don't think it is strictly required, but it
> isn't harmful either.

It's not harmful but suggests it might do something important -
e.g. provide atomicity between the fsync and getting extends.

Can the documentation make it clear that it's exactly equivalent to
calling fsync() before - or, if that's not true, explain the diffence?

> > > * FIEMAP_FLAG_XATTR
> > > If this flag is set, the extents returned will describe the inodes
> > > extended attribute lookup tree, instead of it's data tree.
> > 
> > What is this for?  The meaning of the xattr tree sounds rather
> > filesystem specific to me.
> 
> This is to return the location of the xattr blocks for the inode.

Some filesystems will store xattrs as metadata - in exactly the same
as, say, the inode itself, it's permissions, mappings etc.

I'm not sure why xattrs get special treatment, compared with a
hypothetical FIEMAP_FLAG_METADATA for example, indicating which
physical blocks contain the inode itself, or it's other auxiliary
information.

(Aside: If there was a way to get physical block address for inodes
(without retrieving the inodes, using only the name) I know at least
one program that would benefit from that - it sorts stat() calls by
estimated inode block, which greatly speeds up scanning a large
filesystem.  I realise FIEMAP isn't an appropriate interface for
that.)

> > (I'm assuming 'direct access' means O_DIRECT).
> 
> "NO_DIRECT" has nothing to do with "O_DIRECT".  It just means that,
> per the description a few lines earlier, direct access to the file
> data is impossible (i.e. for lilo or other tool which thinks it can
> open "dev" and seek to "fe_physical" to read the data), or at best
> will have undefined results (e.g. you may get encrypted or compressed
> data back, or it is on the far side of a network interface).

Ok.  This wasn't clear, as 'direct access' means O_DIRECT elsewhere -
and some programs which use FIEMAP are likely to be the same ones
which use O_DIRECT.

Maybe calling it 'physical addressing' or something like that?

Because the field is called 'fe_physical', I'm thinking
FIEMAP_EXTENT_PHYSICAL is a much clearer flag name.  Also reversing
the sense, so it's _set_ when 'fe_physical' is a valid quantity.

(A flag FIEMAP_EXTENT_O_DIRECT to indicate when O_DIRECT access will
work sounds useful too, and quite easy to implement, btw.)

-- Jamie

  parent reply	other threads:[~2008-06-26 12:19 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25 22:18 [PATCH 0/4] Fiemap, an extent mapping ioctl - round 2 Mark Fasheh
2008-06-26  3:03 ` Andreas Dilger
2008-06-26  9:36 ` Jamie Lokier
2008-06-26 10:24   ` Andreas Dilger
2008-06-26 11:37     ` Anton Altaparmakov
2008-06-26 12:19     ` Jamie Lokier [this message]
2008-06-26 13:16       ` Dave Chinner
2008-06-26 13:27         ` Jamie Lokier
2008-06-26 13:48         ` Eric Sandeen
2008-06-26 14:16           ` Jamie Lokier
2008-06-26 16:56             ` Andreas Dilger
2008-06-29 19:12               ` Anton Altaparmakov
2008-06-29 21:45                 ` Dave Chinner
2008-06-30 22:57                   ` Jamie Lokier
2008-06-30 23:07                     ` Mark Fasheh
2008-07-01  2:01                       ` Brad Boyer
2008-07-02  6:38                         ` Andreas Dilger
2008-07-02  6:33                 ` Andreas Dilger
2008-07-02 14:26                   ` Jamie Lokier
2008-06-26 17:17       ` Andreas Dilger
2008-06-26 14:03 ` Eric Sandeen
2008-06-27  1:41   ` Dave Chinner
2008-06-27  9:41     ` Jamie Lokier
2008-06-27 10:01       ` Dave Chinner
2008-06-27 10:32         ` Jamie Lokier
2008-06-27 22:48       ` Andreas Dilger
2008-06-28  4:21         ` Eric Sandeen
2008-07-02  6:26           ` Andreas Dilger
2008-07-02 14:28             ` Jamie Lokier
2008-07-02 21:20               ` Mark Fasheh
2008-07-03 14:45                 ` Jamie Lokier
2008-06-26 14:04 ` Dave Kleikamp
2008-06-26 14:15   ` Eric Sandeen
2008-06-26 14:27     ` Dave Kleikamp
2008-07-02 23:48       ` jim owens
2008-07-03 11:17         ` Dave Chinner
2008-07-03 12:11           ` jim owens
2008-07-03 22:51             ` Dave Chinner
2008-07-04  8:31               ` Andreas Dilger
2008-07-04 12:13               ` Jamie Lokier
2008-07-07  7:40                 ` Dave Chinner
2008-07-07 16:53                   ` Jamie Lokier
2008-07-07 22:51                     ` Dave Chinner
2008-07-07 21:16               ` jim owens
2008-07-08  3:01                 ` Dave Chinner
2008-07-07 22:02               ` jim owens
2008-07-09  2:03                 ` Jamie Lokier
2008-07-03 12:21           ` jim owens
2008-07-03 12:42             ` Andi Kleen
2008-07-04 20:32             ` Anton Altaparmakov
2008-07-05 10:49               ` Jamie Lokier
2008-07-05 21:44                 ` Anton Altaparmakov
2008-07-07 23:01               ` jim owens
2008-07-08  1:51                 ` Dave Chinner
2008-07-08 13:02                   ` jim owens
2008-07-08 14:03                     ` jim owens
2008-07-08 14:39                       ` jim owens
2008-07-08 14:30                     ` Theodore Tso
2008-07-09  1:50                       ` Jamie Lokier
2008-06-26 17:01   ` Andreas Dilger
2008-07-03 14:37 ` jim owens
2008-07-03 15:17   ` Jamie Lokier
2008-07-04  8:49     ` Andreas Dilger
2008-07-04 11:28       ` Jamie Lokier
2008-07-03 23:00   ` Dave Chinner
2008-07-04  9:00   ` Andreas Dilger
2008-07-07 23:28     ` jim owens
2008-07-09  1:53       ` Jamie Lokier
2008-07-09 15:01         ` jim owens
2008-07-08  0:06     ` jim owens

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=20080626121950.GB32417@shareable.org \
    --to=jamie@shareable.org \
    --cc=Kalpak.Shah@sun.com \
    --cc=adilger@shaw.ca \
    --cc=adilger@sun.com \
    --cc=jbacik@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --cc=sandeen@redhat.com \
    /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).