fs/ntfs3: Keep runs for $MFT::$ATTR_DATA and $MFT::$ATTR_BITMAP
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 18 Jun 2024 14:11:37 +0000 (17:11 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Thu, 11 Jul 2024 09:19:43 +0000 (12:19 +0300)
We skip the run_truncate_head call also for $MFT::$ATTR_BITMAP.
Otherwise wnd_map()/run_lookup_entry will not find the disk position for the bitmap parts.

Fixes: 0e5b044cbf3a ("fs/ntfs3: Refactoring attr_set_size to restore after errors")
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/attrib.c

index e62a8fee525058c1613710f1ea39b29017a973ac..1d63e1c9469b99b09dcbfcebb397c5f4a52f4bed 100644 (file)
@@ -672,7 +672,8 @@ pack_runs:
                        goto undo_2;
                }
 
-               if (!is_mft)
+               /* keep runs for $MFT::$ATTR_DATA and $MFT::$ATTR_BITMAP. */
+               if (ni->mi.rno != MFT_REC_MFT)
                        run_truncate_head(run, evcn + 1);
 
                svcn = le64_to_cpu(attr->nres.svcn);