| To: | Nathan Scott <nathans@xxxxxxx> |
|---|---|
| Subject: | Re: xfs corruption with XFS_IOC_RESVSP |
| From: | Miquel van Smoorenburg <miquels@xxxxxxxxxxx> |
| Date: | Fri, 26 Nov 2004 13:58:10 +0000 |
| Cc: | Miquel van Smoorenburg <miquels@xxxxxxxxxxx>, linux-xfs@xxxxxxxxxxx |
| In-reply-to: | <20041126000611.GB953@frodo> (from nathans@sgi.com on Fri Nov 26 01:06:11 2004) |
| References: | <1101413726l.13697l.0l@stargazer.cistron.net> <20041126000611.GB953@frodo> |
| Sender: | linux-xfs-bounce@xxxxxxxxxxx |
On 2004.11.26 01:06, Nathan Scott wrote:
Hi Mike,
I fixed a problem like this some time ago. The reason for the NULLs on read is likely to be as follows... Well actually, I let the 4 processes write the file in parallel, each adding 500-1200 bytes at the end, until the file has grown to 10 M after which I stop the write process and read the file to check for inconsistencies.
But, backing up to your original problem. XFS actually does some preallocation for writes beyond EOF already (in "biosize" chunks). When the file is closed, we go down the xfs_release path, and any excess is trimmed off the end (trimmed back to a filesystem block - xfs_inactive_free_eofblocks). But, if you are writing to those files append-only, you could mark them as such (i.e. chattr +a) -- this will skip the trim-back step and reduce fragmentation for you.
I understand that ext3 also has preallocation support nowadays, perhaps a unified mount option or ioctl would be a good idea. Attached is a first cut at a patch for a mount option - I understand that functional changes like this might not be added (right away, at least) to stable filesystems like XFS, and perhaps it's the wrong approach but it might be useful to other people. Right now I have my filesystem mounted with -o rw,noatime,biosize=18,pkeep and it appears to do what I want without application changes. Thanks, Mike.
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: 2.6.9 Oops: Major problems with XFS and ext3 (VFS related?), Anders Saaby |
|---|---|
| Next by Date: | Re: [REPOST] [PATCH] fs/xfs/linux-2.6/kmem.c, Miquel van Smoorenburg |
| Previous by Thread: | Re: xfs corruption with XFS_IOC_RESVSP, Nathan Scott |
| Next by Thread: | [Bug 389] Untarring an archive corrupts XFS file system, bugzilla-daemon |
| Indexes: | [Date] [Thread] [Top] [All Lists] |