ntfs_volume *vol = ni->vol;
        u8 *kaddr;
        unsigned int rec_size = ni->itype.index.block_size;
-       ntfs_inode *locked_nis[PAGE_SIZE / rec_size];
+       ntfs_inode *locked_nis[PAGE_SIZE / NTFS_BLOCK_SIZE];
        struct buffer_head *bh, *head, *tbh, *rec_start_bh;
        struct buffer_head *bhs[MAX_BUF_PER_PAGE];
        runlist_element *rl;
        bool sync, is_mft, page_is_dirty, rec_is_dirty;
        unsigned char bh_size_bits;
 
+       if (WARN_ON(rec_size < NTFS_BLOCK_SIZE))
+               return -EINVAL;
+
        ntfs_debug("Entering for inode 0x%lx, attribute type 0x%x, page index "
                        "0x%lx.", vi->i_ino, ni->type, page->index);
        BUG_ON(!NInoNonResident(ni));