| To: | David Chinner <dgc@xxxxxxx> |
|---|---|
| Subject: | Re: [RFC] add FIEMAP ioctl to efficiently map file allocation |
| From: | Anton Altaparmakov <aia21@xxxxxxxxx> |
| Date: | Wed, 2 May 2007 12:17:32 +0100 |
| Cc: | Nicholas Miell <nmiell@xxxxxxxxxxx>, linux-ext4@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, hch@xxxxxxxxxxxxx |
| In-reply-to: | <20070502105749.GY77450368@melbourne.sgi.com> |
| References: | <20070416112252.GJ48531920@melbourne.sgi.com> <20070419002139.GK5967@schatzie.adilger.int> <20070419015426.GM48531920@melbourne.sgi.com> <20070430224401.GX5967@schatzie.adilger.int> <20070501042254.GD77450368@melbourne.sgi.com> <1177994346.3362.5.camel@entropy> <20070501142049.GG77450368@melbourne.sgi.com> <084192A9-D739-44F2-AD21-30BC30486F07@cam.ac.uk> <20070502091526.GW77450368@melbourne.sgi.com> <2604946E-CF10-426F-9720-DDABD10C8E0D@cam.ac.uk> <20070502105749.GY77450368@melbourne.sgi.com> |
| Sender: | xfs-bounce@xxxxxxxxxxx |
On Wed, May 02, 2007 at 10:36:12AM +0100, Anton Altaparmakov wrote:On 2 May 2007, at 10:15, David Chinner wrote:On Tue, May 01, 2007 at 07:46:53PM +0100, Anton Altaparmakov wrote:And all applications will run against a multitude of kernels. So version X of the application will run on kernel 2.4.*, 2.6.*, a.b.*, etc... For future expandability of the interface I think it is important to have both compulsory and non-compulsory flags. Yes and my point is that it should not do so as there are flags where it is not necessary. HSM_READ is definitely _NOT_ required because all it means is "if the file is OFFLINE, bring it ONLINE and then return the extent map".
OTOH if the application does not need to use the flag, then it shouldn't be using it and we shouldn't be silently ignoring incorrect usage of the provided API.
No it is not silly at all. There can be flags that fail but still the operation is a success. Example from admittedly unrelated area: when truncating a file to smaller size if the freeing of the allocated blocks fails it does not cause the truncate to fail, it just means some space is wasted/marked used when it is unused on the volume and running fsck fixes this. At least that is how I have implemented it for NTFS and I think this is the most sensible way to do it. The user does not care if some blocks could not be freed. All they care about is that the file is now truncated. The volume is then marked dirty thus running fsck/ chkdsk will reclaim the lost space. It's crazy, isn't it? It makes writing applications portable across operating systems a real PITA (ask the MySQL folk ;) because POSIX really does allow fsync() to be implemented like this. It is only a problem if you do not choose wisely which flags my be ignored silently... And vice versa, an application might specify some weird and funky yet
Also consider what I said above about different kernels. A new
By your reasoning, if we have voluntary flags 1, 2 and 3 and filesystems A, B and C and filesystem A is the only filesystem to implement 1, when B implements 1 bit must become a compulsory flag WHY? It does not at all. Flags CANNOT move from voluntary to compulsory. Read my argument again... and hence C must now return an error despite being unchanged.
Likewise when C implement 3, 3 must become a comulsory flag and A and B must now return an error despite being unchanged.
IOWs, whenever *any* filesystem implements a voluntary feature that it didn't previously support, we have to make that a mandatory feature and all other filesystems that don't support it now
must return an error. You're guaranteeing th application sees changes in behaviour with this interface, not preventing.
Best regards, Anton -- Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer, http://www.linux-ntfs.org/ |
| Previous by Date: | Re: [RFC] add FIEMAP ioctl to efficiently map file allocation, David Chinner |
|---|---|
| Next by Date: | Re: TAKE 963965 - Add lockdep support for XFS, Christoph Hellwig |
| Previous by Thread: | Re: [RFC] add FIEMAP ioctl to efficiently map file allocation, David Chinner |
| Next by Thread: | Re: [RFC] add FIEMAP ioctl to efficiently map file allocation, Andreas Dilger |
| Indexes: | [Date] [Thread] [Top] [All Lists] |