From 366c20e8a20efdc5244eb80c50170c5e26a8b1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 6 Apr 2016 09:32:18 +0200 Subject: [PATCH] Silenced fixup warnings when allocating a new MFT record When creating a new MFT record, do not issue a warning if the current record has bad fixups. These warnings are meaningless, difficult to interpret and cause unneeded worries. --- libntfs-3g/mft.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libntfs-3g/mft.c b/libntfs-3g/mft.c index 304c5baa..29f1f4bc 100644 --- a/libntfs-3g/mft.c +++ b/libntfs-3g/mft.c @@ -1629,6 +1629,7 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, ntfs_inode *base_ni) int err; u32 usa_ofs; le16 seq_no, usn; + BOOL oldwarn; if (base_ni) ntfs_log_enter("Entering (allocating an extent mft record for " @@ -1742,10 +1743,22 @@ found_free_rec: if (!m) goto undo_mftbmp_alloc; + /* + * As this is allocating a new record, do not expect it to have + * been initialized previously, so do not warn over bad fixups + * (hence avoid warn flooding when an NTFS partition has been wiped). + */ + oldwarn = !NVolNoFixupWarn(vol); + NVolSetNoFixupWarn(vol); if (ntfs_mft_record_read(vol, bit, m)) { + if (oldwarn) + NVolClearNoFixupWarn(vol); free(m); goto undo_mftbmp_alloc; } + if (oldwarn) + NVolClearNoFixupWarn(vol); + /* Sanity check that the mft record is really not in use. */ if (ntfs_is_file_record(m->magic) && (m->flags & MFT_RECORD_IN_USE)) { ntfs_log_error("Inode %lld is used but it wasn't marked in "