xfs
[Top] [All Lists]

Re: TAKE - fix last block mmap problems

To: Steve Lord <lord@xxxxxxx>
Subject: Re: TAKE - fix last block mmap problems
From: Steve Lord <lord@xxxxxxx>
Date: 18 Jun 2002 09:35:58 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <200206181416.g5IEG4E12849@jen.americas.sgi.com>
References: <200206181416.g5IEG4E12849@jen.americas.sgi.com>
Sender: owner-linux-xfs@xxxxxxxxxxx
> 
> The problem originates in the write path, which
> means even after the fix there will be files on
> the disk with non-zero contents after the end
> of file. I will be posting a program to fix up
> filesystems shortly.
> 

This is the program to fix up the files left behind by this bug. It
does a tree walk of a directory and mmaps files looking for candidates,
if it finds a file with space in the last block beyond end of file
which has non-zero data in it, it will zero the remainder of the
block. It prints '.' for each 100 files processed, and '+' for each
100 files fixed. The test program assumes a 4K block and 4K page
size, it takes a directory as the starting point. Run it as root.

If you are not experiencing problems then you do not need to run
this, you also probably need to have run a kernel built from cvs
or patch source after May 15th to have this happen to your filesystems.
This bug got into the kernel with the multiple blocksize support.

I have run this on my source tree, root and usr partitions without any
problems. Since it takes any dir tree as a starting point, and can be
re-run without harm, try it on something inconsequential first if you
are worried about it.

Steve

-- 

Steve Lord                                      voice: +1-651-683-3511
Principal Engineer, Filesystem Software         email: lord@xxxxxxx

Attachment: mapcheck.c
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>