At 10:07 09/07/02, ? wrote:
>Changes by: szaka
>
>Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
>In directory usw-pr-cvs1:/tmp/cvs-serv31866
>
>Modified Files:
> ntfsresize.c
>Log Message:
>Don't give up inode walking on EIO: temporary fix for not being
> able to distinguish corrupt and not FILE records easily)
>
>
>Index: ntfsresize.c
>===================================================================
>RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsresize.c,v
>retrieving revision 1.3
>retrieving revision 1.4
>diff -U2 -r1.3 -r1.4
>--- ntfsresize.c 9 Jul 2002 00:00:19 -0000 1.3
>+++ ntfsresize.c 9 Jul 2002 09:07:10 -0000 1.4
>-int err_exit(const char *fmt, ...) {
>-
>+int err_exit(const char *fmt, ...)
>+{
Ah, thanks. (-:
>@@ -237,6 +237,9 @@
> for (inode = 0; inode < vol->nr_mft_records; inode++) {
> mref = (MFT_REF)inode;
>- if (ntfs_read_file_record(vol, mref, &mrec, NULL))
>- perr_exit("ntfs_read_file_record");
>+ if (ntfs_read_file_record(vol, mref, &mrec, NULL)) {
>+ if (errno == EIO)
>+ continue;
>+ perr_exit("ntfs_read_file_record");
>+ }
> if (!(mrec->flags & MFT_RECORD_IN_USE))
> continue;
Are you sure about this one? I am not. If you seen anything that is not a
FILE record you should not continue as you don't know what it means... It
usually means that either something is corrupt in the mft record or that
check disk was running and failed (power failed or whatever). In either
case you would not want to continue I think... If you want to work with
non-FILe records you really should use ntfs_read_mft_record() instead...
Can you tell me what records you found other than file? I have seen CHKD
(check disk), BAAD (corrupt mft record), and from the windows ntfs driver
source I know that HOLE is a valid record but I haven't seen it in the wild
yet and I was too lazy to figure out what it meant by reverse engineering it...
Anton
--
"I've not lost my mind. It's backed up on tape somewhere." - Unknown
--
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
|