Re: XFS issue under 2.6.25.13 kernel

Dave Chinner
2008-08-26T01:40:18Z

On Mon, Aug 25, 2008 at 01:08:29PM +0200, Sławomir Nowakowski wrote:
> 2008/8/23 Dave Chinner <david@fromorbit.com>:
> Next we have created some files:
> -one big file called "bigfile" and size of 5109497856 bytes
> -two small text files called: "file1" and "file2"
>
> At this stage it looked as follows:
....
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/sda3 4993984 4989916 4068 100% /mnt/z
>
> Then we have run system with 2.6.25.13 kernel and checked how it looks:
.....
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/sda3 4993984 4993984 0 100% /mnt/z
>
> As it shown in case of 2.6.25.13 kernel system reports no free space,
> but under 2.6.17.13 kernel there is 4068kB of free space.
>
> At this stage when editing file file1 with i.e. mcedit and trying to
> write changes, the system cuts this file to 0 bytes!

Oh, look, yet another editor that doesn't safely handle ENOSPC and
trashes files when it can't overwrite them. That's not an XFS
problem - I suggest raising a bug against the editor....

> >> Is it known issue and/or does solution or workaround exists?
> >
> > $ sudo xfs_io -x -c 'resblks 0' <file in filesystem>
> >
> > will remove the reservation. This means your filesystem can shutdown
> > or lose data at ENOSPC in certain circumstances....
>
> A question: does using the command:
>
> $ sudo xfs_io -x -c 'resblks 0' <file in filesystem>
>
> for 2.6.25.13 kernel gives higher risk of losing data then in case of
> 2.6.17.13 kernel.

Hard to say. If you don't run to ENOSPC then there is no difference.
If you do run to ENOSPC then I think that there is a slightly higher
risk of tripping problems on 2.6.25.x because of other ENOSPC fixes
that have been included since 2.6.17.13. This really is a safety net
in that it allows the system to continue without problems in
conditions where it would have previously done a bad thing...