Re: FIBMAP/FIEMAP discrepancy for CAP_SYS_RAWIO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* 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.)
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux