From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Dilger Subject: Re: FIBMAP/FIEMAP discrepancy for CAP_SYS_RAWIO Date: Mon, 07 Sep 2009 12:50:14 +0200 Message-ID: <20090907105014.GV4197@webber.adilger.int> References: <87y6osry4k.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT Cc: linux-fsdevel@vger.kernel.org To: Florian Weimer Return-path: Received: from sca-es-mail-2.Sun.COM ([192.18.43.133]:45957 "EHLO sca-es-mail-2.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752672AbZIGKuU (ORCPT ); Mon, 7 Sep 2009 06:50:20 -0400 Received: from fe-sfbay-09.sun.com ([192.18.43.129]) by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n87AoGkr003369 for ; Mon, 7 Sep 2009 03:50:18 -0700 (PDT) Content-disposition: inline Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) id <0KPL00100KIW2X00@fe-sfbay-09.sun.com> for linux-fsdevel@vger.kernel.org; Mon, 07 Sep 2009 03:50:16 -0700 (PDT) In-reply-to: <87y6osry4k.fsf@mid.deneb.enyo.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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. 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). Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc.