fs/ntfs3: One more reason to mark inode bad
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Thu, 30 May 2024 07:55:12 +0000 (10:55 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Wed, 26 Jun 2024 12:48:51 +0000 (15:48 +0300)
In addition to returning an error, mark the node as bad.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/frecord.c

index 4822cfd6351c27cc75b568043507405331b4d6b1..c7ab8d6f38964b2a771afd283a2bdab6d59605fd 100644 (file)
@@ -1601,8 +1601,10 @@ int ni_delete_all(struct ntfs_inode *ni)
                asize = le32_to_cpu(attr->size);
                roff = le16_to_cpu(attr->nres.run_off);
 
-               if (roff > asize)
+               if (roff > asize) {
+                       _ntfs_bad_inode(&ni->vfs_inode);
                        return -EINVAL;
+               }
 
                /* run==1 means unpack and deallocate. */
                run_unpack_ex(RUN_DEALLOCATE, sbi, ni->mi.rno, svcn, evcn, svcn,