diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 481219f2a7cf..2bfcf1a989c9 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -3360,7 +3360,7 @@ int ni_write_inode(struct inode *inode, int sync, 
const char *hint)
      ni_unlock(ni);

      if (err) {
-        ntfs_err(sb, "%s r=%lx failed, %d.", hint, inode->i_ino, err);
+        ntfs_inode_err(inode, "%s failed, %d.", hint, err);
          ntfs_set_state(sbi, NTFS_DIRTY_ERROR);
          return err;
      }
diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c
index 0a82b1bf3ec2..28cc421102e5 100644
--- a/fs/ntfs3/fsntfs.c
+++ b/fs/ntfs3/fsntfs.c
@@ -223,7 +223,7 @@ int ntfs_extend_init(struct ntfs_sb_info *sbi)
      inode = ntfs_iget5(sb, &ref, &NAME_EXTEND);
      if (IS_ERR(inode)) {
          err = PTR_ERR(inode);
-        ntfs_err(sb, "Failed to load $Extend.");
+        ntfs_err(sb, "Failed to load $Extend (%d).", err);
          inode = NULL;
          goto out;
      }
@@ -282,7 +282,7 @@ int ntfs_loadlog_and_replay(struct ntfs_inode *ni, 
struct ntfs_sb_info *sbi)

      /* Check for 4GB. */
      if (ni->vfs_inode.i_size >= 0x100000000ull) {
-        ntfs_err(sb, "\x24LogFile is too big");
+        ntfs_err(sb, "\x24LogFile is large than 4G.");
          err = -EINVAL;
          goto out;
      }
@@ -1863,7 +1863,7 @@ int ntfs_security_init(struct ntfs_sb_info *sbi)
      inode = ntfs_iget5(sb, &ref, &NAME_SECURE);
      if (IS_ERR(inode)) {
          err = PTR_ERR(inode);
-        ntfs_err(sb, "Failed to load $Secure.");
+        ntfs_err(sb, "Failed to load $Secure (%d).", err);
          inode = NULL;
          goto out;
      }
@@ -1874,45 +1874,43 @@ int ntfs_security_init(struct ntfs_sb_info *sbi)

      attr = ni_find_attr(ni, NULL, &le, ATTR_ROOT, SDH_NAME,
                  ARRAY_SIZE(SDH_NAME), NULL, NULL);
-    if (!attr) {
-        err = -EINVAL;
-        goto out;
-    }
-
-    if(!(root_sdh = resident_data_ex(attr, sizeof(struct INDEX_ROOT))) ||
+    if (!attr ||
+        !(root_sdh = resident_data_ex(attr, sizeof(struct INDEX_ROOT))) ||
          root_sdh->type != ATTR_ZERO ||
          root_sdh->rule != NTFS_COLLATION_TYPE_SECURITY_HASH ||
          offsetof(struct INDEX_ROOT, ihdr) +
-            le32_to_cpu(root_sdh->ihdr.used) >
-            le32_to_cpu(attr->res.data_size)) {
+                le32_to_cpu(root_sdh->ihdr.used) >
+            le32_to_cpu(attr->res.data_size)) {
+        ntfs_err(sb, "$Secure::$SDH is corrupted.");
          err = -EINVAL;
          goto out;
      }

      err = indx_init(indx_sdh, sbi, attr, INDEX_MUTEX_SDH);
-    if (err)
+    if (err) {
+        ntfs_err(sb, "Failed to initialize $Secure::$SDH (%d).", err);
          goto out;
+    }

      attr = ni_find_attr(ni, attr, &le, ATTR_ROOT, SII_NAME,
                  ARRAY_SIZE(SII_NAME), NULL, NULL);
-    if (!attr) {
-        err = -EINVAL;
-        goto out;
-    }
-
-    if(!(root_sii = resident_data_ex(attr, sizeof(struct INDEX_ROOT))) ||
+    if (!attr ||
+        !(root_sii = resident_data_ex(attr, sizeof(struct INDEX_ROOT))) ||
          root_sii->type != ATTR_ZERO ||
          root_sii->rule != NTFS_COLLATION_TYPE_UINT ||
          offsetof(struct INDEX_ROOT, ihdr) +
-            le32_to_cpu(root_sii->ihdr.used) >
-            le32_to_cpu(attr->res.data_size)) {
+                le32_to_cpu(root_sii->ihdr.used) >
+            le32_to_cpu(attr->res.data_size)) {
+        ntfs_err(sb, "$Secure::$SII is corrupted.");
          err = -EINVAL;
          goto out;
      }

      err = indx_init(indx_sii, sbi, attr, INDEX_MUTEX_SII);
-    if (err)
+    if (err) {
+        ntfs_err(sb, "Failed to initialize $Secure::$SII (%d).", err);
          goto out;
+    }

      fnd_sii = fnd_get();
      if (!fnd_sii) {
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 521ce31d67a1..e0f78b306f15 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -734,48 +734,81 @@ static int ntfs_init_from_boot(struct super_block 
*sb, u32 sector_size,
      err = -EINVAL;
      boot = (struct NTFS_BOOT *)bh->b_data;

-    if (memcmp(boot->system_id, "NTFS    ", sizeof("NTFS    ") - 1))
+    if (memcmp(boot->system_id, "NTFS    ", sizeof("NTFS    ") - 1)) {
+        ntfs_err(sb, "Boot's signature is not NTFS.");
          goto out;
+    }

      /* 0x55AA is not mandaroty. Thanks Maxim Suhanov*/
      /*if (0x55 != boot->boot_magic[0] || 0xAA != boot->boot_magic[1])
       *    goto out;
       */

-    boot_sector_size = (u32)boot->bytes_per_sector[1] << 8;
-    if (boot->bytes_per_sector[0] || boot_sector_size < SECTOR_SIZE ||
+    boot_sector_size = ((u32)boot->bytes_per_sector[1] << 8) |
+               boot->bytes_per_sector[0];
+    if (boot_sector_size < SECTOR_SIZE ||
          !is_power_of_2(boot_sector_size)) {
+        ntfs_err(sb, "Invalid bytes per sector %u.", boot_sector_size);
          goto out;
      }

      /* cluster size: 512, 1K, 2K, 4K, ... 2M */
      sct_per_clst = true_sectors_per_clst(boot);
-    if ((int)sct_per_clst < 0)
-        goto out;
-    if (!is_power_of_2(sct_per_clst))
+    if ((int)sct_per_clst < 0 || !is_power_of_2(sct_per_clst)) {
+        ntfs_err(sb, "Invalid sectors per cluster %u.", sct_per_clst);
          goto out;
+    }
+
+    sbi->cluster_size = boot_sector_size * sct_per_clst;
+    sbi->cluster_bits = cluster_bits = blksize_bits(sbi->cluster_size);
+    sbi->cluster_mask = sbi->cluster_size - 1;
+    sbi->cluster_mask_inv = ~(u64)sbi->cluster_mask;

      mlcn = le64_to_cpu(boot->mft_clst);
      mlcn2 = le64_to_cpu(boot->mft2_clst);
      sectors = le64_to_cpu(boot->sectors_per_volume);

-    if (mlcn * sct_per_clst >= sectors)
+    if (mlcn * sct_per_clst >= sectors || mlcn2 * sct_per_clst >= 
sectors) {
+        ntfs_err(
+            sb,
+            "Start of MFT 0x%llx (0x%llx) is out of volume 0x%llx.",
+            mlcn, mlcn2, sectors);
          goto out;
+    }

-    if (mlcn2 * sct_per_clst >= sectors)
-        goto out;
+    sbi->record_size = record_size =
+        boot->record_size < 0 ? 1 << (-boot->record_size) :
+                          (u32)boot->record_size << cluster_bits;
+    sbi->record_bits = blksize_bits(record_size);
+    sbi->attr_size_tr = (5 * record_size >> 4); // ~320 bytes

      /* Check MFT record size. */
-    if ((boot->record_size < 0 &&
-         SECTOR_SIZE > (2U << (-boot->record_size))) ||
-        (boot->record_size >= 0 && !is_power_of_2(boot->record_size))) {
+    if (record_size < SECTOR_SIZE || !is_power_of_2(record_size)) {
+        ntfs_err(sb, "Invalid bytes per MFT record %u (%d).",
+             record_size, boot->record_size);
+        goto out;
+    }
+
+    if (record_size > MAXIMUM_BYTES_PER_MFT) {
+        ntfs_err(sb, "Unsupported bytes per MFT record %u.",
+             record_size);
          goto out;
      }

+    sbi->index_size = boot->index_size < 0 ?
+                    1u << (-boot->index_size) :
+                    (u32)boot->index_size << cluster_bits;
+
      /* Check index record size. */
-    if ((boot->index_size < 0 &&
-         SECTOR_SIZE > (2U << (-boot->index_size))) ||
-        (boot->index_size >= 0 && !is_power_of_2(boot->index_size))) {
+    if (sbi->index_size < SECTOR_SIZE || !is_power_of_2(sbi->index_size)) {
+        ntfs_err(sb, "Invalid bytes per index %u(%d).", sbi->index_size,
+             boot->index_size);
+        goto out;
+    }
+
+    if (sbi->index_size > MAXIMUM_BYTES_PER_INDEX) {
+        ntfs_err(sb, "Unsupported bytes per index %u.",
+             sbi->index_size);
          goto out;
