All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Andreas Dilger <adilger@sun.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: FIBMAP/FIEMAP discrepancy for CAP_SYS_RAWIO
Date: Mon, 07 Sep 2009 16:26:22 +0000	[thread overview]
Message-ID: <87y6oqd8lt.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <20090907105014.GV4197@webber.adilger.int> (Andreas Dilger's message of "Mon, 07 Sep 2009 12:50:14 +0200")

* Andreas Dilger:

> On Sep 06, 2009  13:39 +0000, Florian Weimer wrote:
>> The FIBMAP ioctl requires CAP_SYS_RAWIO, but FIEMAP doesn't.  Why's
>> that?  Is it that there is no backwards-compatible way to introduce
>> locking on the bmap path?
>
> I'm not sure why there is a root-only requirement for FIBMAP, but the
> FIEMAP data is definitely useful even for non-root users for many
> reasons, such as optimized file copies/rsync/tar/etc skipping holes
> in sparse files easily.

I'm slightly worried because the generic FIEMAP-on-FIBMAP
implementation takes the inode mutex, but the FIBMAP ioctl doesn't.

> If you are implementing a tool to use this, I would code it to try
> FIEMAP first, then FIBMAP (if it is running as root, or it gets
> fixed in some future kernel), then just do without (as it most likely
> does already today).

If FIBMAP is unsafe, it's likely exposed by concurrent changes to the
file, so using it would still be unsafe for backup purposes.  And I
really only need the number of the first block.  (I want to optimize
reading of Maildir-style folders, mainly for backup purposes.)

  parent reply	other threads:[~2009-09-07 16:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-06 13:39 FIBMAP/FIEMAP discrepancy for CAP_SYS_RAWIO Florian Weimer
2009-09-07 10:50 ` Andreas Dilger
2009-09-07 13:28   ` Theodore Tso
2009-09-07 16:26   ` Florian Weimer [this message]
2009-09-08  7:23     ` Andreas Dilger
2009-09-08  8:47       ` Jamie Lokier
2009-09-09 16:13         ` Andreas Dilger

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=87y6oqd8lt.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=adilger@sun.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.