From e43f58e0e4534d101653065a65121d2ab8e4493f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Fri, 17 Apr 2015 09:37:11 +0200 Subject: [PATCH] Avoided logging meaningless fixup errors in ntfswipe As ntfswipe examines all MFT entries, it may find uninitialized ones. They should not be considered as erroneous ones even if the fixups are wrong. --- ntfsprogs/ntfswipe.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ntfsprogs/ntfswipe.c b/ntfsprogs/ntfswipe.c index b3b8bb94..fe251cd1 100644 --- a/ntfsprogs/ntfswipe.c +++ b/ntfsprogs/ntfswipe.c @@ -873,6 +873,9 @@ static s64 wipe_tails(ntfs_volume *vol, int byte, enum action act) nr_mft_records = vol->mft_na->initialized_size >> vol->mft_record_size_bits; + /* Avoid getting fixup warnings on unitialized inodes */ + NVolSetNoFixupWarn(vol); + for (inode_num = FILE_first_user; inode_num < nr_mft_records; inode_num++) { s64 attr_wiped; @@ -923,6 +926,7 @@ close_inode: ntfs_inode_close(ni); } close_abort : + NVolClearNoFixupWarn(vol); ntfs_log_quiet("wipe_tails 0x%02x, %lld bytes\n", byte, (long long)total); return total; @@ -1236,6 +1240,9 @@ static s64 wipe_directory(ntfs_volume *vol, int byte, enum action act) nr_mft_records = vol->mft_na->initialized_size >> vol->mft_record_size_bits; + /* Avoid getting fixup warnings on unitialized inodes */ + NVolSetNoFixupWarn(vol); + for (inode_num = 5; inode_num < nr_mft_records; inode_num++) { u32 indx_record_size; s64 wiped; @@ -1336,6 +1343,7 @@ close_inode: ntfs_inode_close(ni); } + NVolClearNoFixupWarn(vol); ntfs_log_quiet("wipe_directory 0x%02x, %lld bytes\n", byte, (long long)total); return total; @@ -1723,14 +1731,18 @@ static int destroy_record(ntfs_volume *nv, const s64 record, return -2; } + /* Avoid getting fixup warnings on unitialized inodes */ + NVolSetNoFixupWarn(nv); /* Read the MFT reocrd of the i-node */ if (ntfs_attr_mst_pread(mft, nv->mft_record_size * record, 1LL, nv->mft_record_size, file->mft) < 1) { + NVolClearNoFixupWarn(nv); ntfs_attr_close(mft); free_file(file); return -3; } + NVolClearNoFixupWarn(nv); ntfs_attr_close(mft); mft = NULL;